Click to See Complete Forum and Search --> : codes for situation when one clicks on a checkbox, certain checkboxes are checked too


tapleq
10-29-2003, 10:08 PM
i need help with this problem
this is what i'm supposed to do-
when i check checkbox 1 or 2, i want checkbox 5,6,7 to be checked as well..
i hv no idea how to do this so any help would be greatly appreciated

Mr J
10-30-2003, 07:01 AM
Please try the following


<script>
function chkme(){
if(document.forms[0].elements[0].checked==true||document.forms[0].elements[1].checked==true){
document.forms[0].elements[4].checked=true
document.forms[0].elements[5].checked=true
document.forms[0].elements[6].checked=true
}
}
</script>
<form>
<input type="checkbox" onclick="chkme()">
<input type="checkbox" onclick="chkme()">
<input type="checkbox" onclick="chkme()">
<input type="checkbox" onclick="chkme()">
<input type="checkbox" onclick="chkme()">
<input type="checkbox" onclick="chkme()">
<input type="checkbox" onclick="chkme()">
</form>

tapleq
10-30-2003, 07:19 PM
hey thx..it works..
the other i tried i kinda forget to add the onClick function to the checkbox..