<form id="form1" name="form1" method="post" action="222.php">
<label>
<input type="submit" name="button" id="button" value="提交" />
<input type="text" name="t" id="textfield" />
<br />
</label>
<input type=checkbox name=mm[] value=a ><br>
<input type=checkbox name=mm[] value=b ><br>
<input type=checkbox name=mm[] value=c ><br>
<input type=checkbox name=mm[] value=d ><br>
<input type=checkbox name=mm[] value=e ><br><br>
<input type=checkbox name=mmAll onclick="checkAll(this, 'mm[]')">全选与不全选的切换
</form>
<script language=Javascript>
function checkAll(e, itemName)
{
var aa = document.getElementsByName(itemName);
for (var i=0; i<aa.length; i++)
aa[i].checked = e.checked;
}
}
</script>