function AllCheck(){
"use strict";
var checked = document.formnm.chkall.checked;
for (var i=0, len=document.formnm.elements['chkbx[]'].length;i<len;i++ ){
document.formnm.elements['chkbx[]'][i].checked = checked;
}
}
<form name="formnm" action="" method="POST">
<input type="checkbox" name="chkall" onclick="AllCheck()" />全てにチェック
<input type="checkbox" name="chkbx[]" value="1">1
<input type="checkbox" name="chkbx[]" value="2">2
<input type="checkbox" name="chkbx[]" value="3">3
<input type="submit">
</form>