Wednesday, March 5, 2008

Disable a Crm Form field

Many blogs have this content on how to disable a crmForm field. I am not sampling code for how to disable a field but two different views of a disabled field and its code.

Does the below shown crm field appear disabled? Yes. Well, this is how you can achieve it at run time.


Code 1:
crmForm.all.prefix_entityname.Disabled = true;


Does the below shown crm field appear disabled? If your say is no. You are of course right. It does not look disabled, indeed it is.

And this is how you achieve it.

Code 2:
crmForm.all.prefix_entityname.disabled = true;

So, disabling a crmform field can take two different views as shown above.
Carefully admiring the code you will notice the difference.
Code 1: Capital D, Disabled
Code 2: Small Letter d, disabled.

Happy disabling crm form field.