<scrīpt LANGUAGE="Javascrīpt">
<!--
function hs(){
var s = document.getElementsByName("chkStudent");
var s2 = "";
for( var i = 0; i < s.length; i++ )
{
if ( s[i].checked ){
s2 += s[i].value+'','';
}
}
s2 = s2.substr(0,s2.length-1);
alert(s2);
location.href = "delete.jsp?id="+s2; //这里传过去的是已逗号分隔开的id,需要在后面的页面内取出
}
//-->
</scrīpt>
<BODY>
<INPUT TYPE="checkbox" NAME="chkStudent" value=1>1<br>
<INPUT TYPE="checkbox" NAME="chkStudent" value=2>2<br>
<INPUT TYPE="checkbox" NAME="chkStudent" value=3>3<br>
<INPUT TYPE="checkbox" NAME="chkStudent" value=4>4<br>
<INPUT TYPE="checkbox" NAME="chkStudent" value=5>5<br>
<INPUT TYPE="button" value=''查看结果'' ōnclick="hs()">
posted on 2008-02-14 14:58  cqsar  阅读(34346)  评论(0编辑  收藏  举报