Here is an example to attach event to CRM Field
Function:
Function attachEvent (elementID, eventName, handler){
var obj =document.getElementById(elementID);
if (!element)
return;
element.attachEvent(eventName, handler);
}
Call Example:
attachEvent ('firstname’, 'onchange', handleFirstNameChanged);
Enjoy,
Rami Heleg