Fire an event on any CRM field change
The following code shows how you can attach any function to all of the fields on a CRM form for execution when any of them change. It's based on Michael Höhne's code to find all fields on a form:
FieldChange = function () {
alert("Change!");
}
for (var index in crmForm.all) {
var control = crmForm.all[index];
if (control.req && (control.Disabled != null)) {
control.attachEvent("onchange", FieldChange);
}
}
FieldChange = function () {
alert("Change!");
}
for (var index in crmForm.all) {
var control = crmForm.all[index];
if (control.req && (control.Disabled != null)) {
control.attachEvent("onchange", FieldChange);
}
}

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home