Here is the JavaScript:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function checkAll(checkname, checksubmit) {
for (i = 0; i < checkname.length; i++)
checkname[i].checked = checksubmit.checked? true:false
}
// End -->
</script>
Here is some sample HTML:
<form name="myform" action="myform.php" method="post">
<b>Your Favorites</b><br>
<input type="checkbox" name="list" value="1">Pie<br>
<input type="checkbox" name="list" value="2">Pizza<br>
<input type="checkbox" name="list" value="3">Candy<br>
<input type="checkbox" name="list" value="4">Soda<br>
<input type="checkbox" name="list" value="5">Antacids<br>
<input type="checkbox" name="listAllCheck" value="listAllCheck" onClick="checkAll(document.myform.list,this)"><strong>Check / Uncheck All</strong><br>
</form>