hi all
I've got a form with a hundred or so checkboxes. I want to set up small
groups of them to check/uncheck. I can't use the name (form processing,
diff order) so I'm trying to use the ID.

the bit I'm stuck on is getting an array of checkboxes and then looping
thru them to check only using the ID. I can get the first one to work but
not the other ones of the same name. any ideas?

thanx
barry.b


<script>
function checkAll(id) {
        cbox = eval("document.getElementById(id)"); 
        if (cbox.checked == true){
                cbox.checked = false;
                return "Check All";
        }else{
                cbox.checked = true;
                return "Uncheck All";
        }
}
</script>

here's part of the form 

                                
<td><input type=button value="Check All" 
onClick="this.value=checkAll('view_ADM')"></td>
<td><input type=button value="Check All" onClick="this.value=checkAll('add_ADM')"></td>
<td><input type=button value="Check All" 
onClick="this.value=checkAll('edit_ADM')"></td>
<td><input type=button value="Check All" onClick="this.value=checkAll('del_ADM')"></td>
</tr>
<tr>
<td> Menu Admin </td>
<td><input type="Checkbox" name="Perm_b_40 " id="view_ADM" checked></td>
<td><input type="Checkbox" name="Perm_b_37 " id="add_ADM"></td>
<td><input type="Checkbox" name="Perm_b_39 " id="edit_ADM"></td>
<td><input type="Checkbox" name="Perm_b_38 " id="del_ADM"></td>
</tr>
<tr>
<td> Users Admin  </td>
<td><input type="Checkbox" name="Perm_b_36 " id="view_ADM" checked></td>
<td><input type="Checkbox" name="Perm_b_33 " id="add_ADM"></td><td><input 
type="Checkbox" name="Perm_b_35 "id="edit_ADM"></td>
<td><input type="Checkbox" name="Perm_b_34 " id="del_ADM"></td>
</tr>
<tr>
<td> Utilities Admin  </td>
<td><input type="Checkbox" name="Perm_b_44 " id="view_ADM" checked></td>
<td><input type="Checkbox" name="Perm_b_41 " id="add_ADM"></td>
<td><input type="Checkbox" name="Perm_b_43 " id="edit_ADM"></td>
</tr>

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to