停止复选框单击表单其他功能

时间:2016-10-05 05:24:22

标签: javascript jquery html

我想在下方按钮的功能调用

上停止点击复选框
//Checkbox
<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
</label>
//Button
 <div class="detail-view" id="detail-view-id"><a id="detailview" onclick="get_fields('DetailView')">Detail View</a></div>

get_fields(name){
    //I want to stop checkbox click for full execution of this function
    code
    //enable that click 
 }

1 个答案:

答案 0 :(得分:1)

您可以在执行功能时禁用该复选框

get_fields(name){
    document.getElementById("chksetreflayout").disabled = true;
    code
    document.getElementById("chksetreflayout").disabled = false;
 }