checkbox全选

类别:Asp 点击:0 评论:0 推荐:
checkbox全选<head></head>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
var checkflag = "false";
function check(field) {
if (checkflag == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
checkflag = "true";
return "false"; }
else {
for (i = 0; i < field.length; i++) {
field[i].checked = false; }
checkflag = "false";
return "true"; }
}
//  End -->
</script>

<body></body>
<form name="form" method="post" action="">

<input type="checkbox" name="list" value="1">

<input type="checkbox" name="list" value="2">

<input type="checkbox" name="list" value="3">

<input type=checkbox value="全选" onClick="this.value=check(this.form.list)">
                  选中所有显示记录

本文地址:http://com.8s8s.com/it/it8002.htm