locked
CRM 2011 CheckBox Onclick Event RRS feed

  • Question

  • Hi ,

    i Have a requirement of on click event of the check box. I have written the following code. Each and every time i am getting the value at true for the checkbox (new_tagvaluesshowpicklist) on click event.

    My requirement was on click of the CheckBox, it shoud give true or false in the toggle function where i can do some custom events.

    Can help me how to achieve this or sample code.

     

     functin Onload()

    {

       var el = document.getElementById("new_tagvaluesshowpicklist");
    }    //    el.attachEvent('onclick', Onchangefunction, false);

    function onchangefunction()

    {

       var a = Xrm.Page.data.entity.attributes.get("new_tagvaluesshowpicklist");
        if (Xrm.Page.ui.controls.get("new_tagvaluesshowpicklist") == undefined) {
            return;
        }
       
        var _attribuite = Xrm.Page.getAttribute("new_tagvaluesshowpicklist");
        if (_attribuite.getValue() == true) {
            //show the below fields
            ShowOrHideField("new_tags", true, true); //showing the field
        }
        else {
            //Hide the Below fields
            ShowOrHideField("new_tags", false, true); // Hiding the field
           
        }

    }

     

     

    Thanks

    srinivas

    Thursday, September 8, 2011 4:52 PM

Answers

All replies