here's my code:
<script type="text/javascript">
function checkUncheckAll(t, type) {
for(i=1; i<t.length; i++) {
if (t[i].name == "hosting[]" && type == "hosting")
t[i].checked=t[0].checked;
if (t[i].name == "se[]" && type == "se") t[i].checked=t[0].checked;
if (t[i].name == "ml[]" && type == "ml") t[i].checked=t[0].checked;
}
}
</script>
<form>
<input type="checkbox" onclick="checkUncheckAll(this.form, 'hosting');"
checked>select/unselect all hosting<br>
<input type="checkbox" onclick="checkUncheckAll(this.form, 'se');"
checked>select/unselect all search engine<br>
<input type="checkbox" onclick="checkUncheckAll(this.form, 'ml');"
checked>select/unselect all mailing list<br>
For some reason it only seems to work for whatever call to checkUncheckAll()
is first and not the other two. Any help would be appreciated.