Tuesday, January 12, 2010

CRM Javascript: Loop through all elements

var iLen = crmForm.all.length;
for (i = 0; i < iLen; i++)
{
o = crmForm.all[i];
switch (o.tagName)
{
case "INPUT":
case "SELECT":
case "TEXTAREA":
case "IMG":
case "IFRAME":
if (o.id != "leadqualitycode")
{
o.disabled = true;
}
if (o.IsDirty)
{
alert("The value of " + o.name + " has changed.");
}

break;
default:
break;
}
}


More help can be taken from :
http://blogs.infinite-x.net/2007/11/21/disabling-all-fields-on-a-crm-form/

No comments:

Post a Comment