Script to Disable multiple Checkboxes with ColdFusion

<html>
<head>
<script type="text/javascript">
function toggleGroup(id) {
    var group = document.getElementById(id);
    var inputs = group.getElementsByTagName("input");
    for (var i = 0; i < inputs.length; i++) {
        inputs[i].disabled = (inputs[i].disabled) ? false : true;
    }
   
}
window.onload = function() {
document.getElementById("checkmain").onchange = function() {
   toggleGroup("check_grp");
  
}
}
</script>
</head>
<body>
 <cfform name="form1" >
    <cfinput type="checkbox" name="checkmain" id="checkmain" />Enable/Disable<br />
    <p id="check_grp">
         <input type="checkbox" /><label for="check1">check 1</label>
         <input type="checkbox"  /><label for="check2">check 2</label>
         <input type="checkbox"  /><label for="check3">check 3</label>
         <input type="checkbox"  /><label for="check4">check 4</label>
         <input type="checkbox"  /><label for="check5">check 5</label>
    </p>
</cfform>
</body>
</html>

Comments

Popular posts from this blog

how to add new line in google form questions | Fix for next line issue in google form questions

How to add new line in dropdown type question in google forms