chhaya_patel chhaya_patel - 1 year ago 99
HTML Question

Stop Checkbox click form other function

I want to stop click event of checkbox on this below button's function call

<label id="lblsetrefmodule" for="chksetreflayout" class="lbl-disable">
<input id="chksetreflayout" class="data_checkbox" onchange="RefLayoutDisplay();" type="checkbox" style="display:none; margin-right: 8px;" disabled="disabled">Set Reference Module Layout
<div class="detail-view" id="detail-view-id"><a id="detailview" onclick="get_fields('DetailView')">Detail View</a></div>

//I want to stop checkbox click for full execution of this function
//enable that click

Answer Source

You can disable the checkbox while the function executed

    document.getElementById("chksetreflayout").disabled = true;
    document.getElementById("chksetreflayout").disabled = false;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download