<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<input type="checkbox" name="m" value="1">
<input type="checkbox" name="m" value="2">
<input type="checkbox" name="m" value="3">
<input type="checkbox" name="m" value="4">
<input type="checkbox" name="m" value="5">
<input type="checkbox" name="m" value="6">
<input type="checkbox" name="m" value="8">
<input type="checkbox" name="m" value="9">
全选<input type=checkbox value="Check All" onclick="mm(this)">
<input type="button" value="提交值" onclick="getpost()" />
<script language=javascript>
function mm(o)
{
var a = document.getElementsByName("m");
for (var i=0; i<a.length; i++){
a[i].checked = o.checked;
}
}
function getpost(){
var checkValues = document.getElementsByName("m");
var jsMxxh = "";
for (var i = 0; i < checkValues.length; i = i + 1) {
if (checkValues[i].checked) {
jsMxxh += checkValues[i].value + ",";
}
}
alert(jsMxxh);
}
</script>
</body>
</html>