Only one selected checkbox

后端 未结 8 1787
梦毁少年i
梦毁少年i 2021-01-14 05:17

I have 15 check boxes in a form. This checkboxes are independent to eachother. I want a javascript function that makes, when user is selecting 2 checkboxes, the first checke

8条回答
  •  广开言路
    2021-01-14 05:37

    Can check like this:

    At javascript:

    function call(no, value) {
        if(no== 0){
            document.frmMTR.check2.checked = false
            document.frmMTR.check3.checked = false;     
        }
        else if(no== 1){
            document.frmMTR.check1.checked = false
            document.frmMTR.check3.checked = false; 
        }
        else if(no== 2){
            document.frmMTR.check1.checked = false
            document.frmMTR.check2.checked = false; 
        }
    }
    

    At html:

     
     
     
    

提交回复
热议问题