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!!