{"id":350,"date":"2010-09-09T10:41:29","date_gmt":"2010-09-09T10:41:29","guid":{"rendered":"http:\/\/mahenderpal.wordpress.com\/?p=350"},"modified":"2010-09-09T10:41:29","modified_gmt":"2010-09-09T10:41:29","slug":"attach-onclick-with-ms-crm-crm-checkbox","status":"publish","type":"post","link":"https:\/\/himbap.com\/blog\/?p=350","title":{"rendered":"Attach onclick event with MS CRM CRM checkbox"},"content":{"rendered":"<p>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 \u201cCalculate Value\u201d 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.<\/p>\n<p>\u00a0So if we will write some code onchange event of this bit field<\/p>\n<p>alert(\u2018Clicked\u2019);<\/p>\n<p>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<\/p>\n<p>crmForm.all.new_calculatevalue.onclick=function()<\/p>\n<p>{<\/p>\n<p>alert(\u2018Clicked\u2019);<\/p>\n<p>\u00a0}<\/p>\n<p>after that you can simple check\u00a0DataValue for bit\u00a0,if it is true or false to work accordingly<\/p>\n<p>\u00a0Enjoy!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 \u201cCalculate Value\u201d and we want to calculate some value on the selection of this bit&#8230; <a href=\"https:\/\/himbap.com\/blog\/?p=350\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[24,10],"tags":[],"_links":{"self":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/350"}],"collection":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=350"}],"version-history":[{"count":0,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/350\/revisions"}],"wp:attachment":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}