Thursday, July 22, 2010

Figure out what element fired the a function

Hello Gang,

Every once in a while I'll write a JavaScript function that is generic; it can handle requests from several different form elements. The function needs to know what element fired it. Here's how to figure that out:

    if(!e) {e = window.event;}
var element = e.srcElement;
Now that you nave the 'element' object you can now reference it via the 'crmForm' object.

 crmForm.all[element.id].DataValue

Get busy!