foregump(临江一笑) 请进来看看
XKP 2003-06-24 10:00:59 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<script language = "javaScript">
function ClickCheck( form ){
for (var i=0; i < form.elements.length; i++ ){
var e = form.elements[i];
if( e.type != "checkbox" ){
continue;
}
if( e.checked == true ){
checkSub( form, e );
}
}
}
function checkSub( form, e ){
var ch="checkbox";
var parentValue = e.value;
for( var j = 0; j < form.elements.length; j++ ){
var f = form.elements[j];
if( f.type != "checkbox" ){
continue;
}
if( f.name.substring( 8 ) == parentValue ){
f.checked = e.checked;
if( f.checked == true ){
checkSub( form, f );
}
}
}
}
</script>
<body>
<form name="form1" method="post" action="">
<p>
<input type="checkbox" name="checkbox0" value="1" onClick="ClickCheck(form1)" >
1 </p>
<p>--
<input type="checkbox" name="checkbox1" value="2" onClick="ClickCheck(form1)">
11 </p>
<p> --
<input type="checkbox" name="checkbox1" value="3" onClick="ClickCheck(form1)">
12</p>
<p>--
<input type="checkbox" name="checkbox1" value="4" onClick="ClickCheck(form1)">
13</p>
<p> ----
<input type="checkbox" name="checkbox4" value="5" onClick="ClickCheck(form1)">
131</p>
<p> ----
<input type="checkbox" name="checkbox4" value="6" onClick="ClickCheck(form1)">
132</p>
<p>----
<input type="checkbox" name="checkbox4" value="7" onClick="ClickCheck(form1)">
133</p>
<p>----
<input type="checkbox" name="checkbox4" value="8" onClick="ClickCheck(form1)">
134</p>
</form>
</body>
</html>