Attach onclick event with MS CRM CRM checkbox


As you know that we can set control formatting of bit field to use it as checkbox. But only changing formatting does not make it to behave like a checkbox because of onchange event. Let take an example for this, like we have one field “Calculate Value” and we want to calculate some value on the selection of this bit field. We can set control formatting for the bit field to display like a checkbox.

 So if we will write some code onchange event of this bit field

alert(‘Clicked’);

You will not get this alert until you will move focus from this field. so make it to behave like real checkbox you have to attach onclick event with this field. You can do this using below code on form onload

crmForm.all.new_calculatevalue.onclick=function()

{

alert(‘Clicked’);

 }

after that you can simple check DataValue for bit ,if it is true or false to work accordingly

 Enjoy!!

Advertisements

1 Comment

Filed under JS Script, MS CRM 4.0

One response to “Attach onclick event with MS CRM CRM checkbox

  1. That had been pretty imformative. Thank you for all the material.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s