随笔-51  评论-14  文章-0  trackbacks-0

 

<SCRIPT LANGUAGE="javascript"> 

<!-- Begin

function anyCheck(form) {

var total 
= 0;

var max 
= form.ckbox.length;

for (var idx = 0; idx < max; idx++) {

if (eval("document.playlist.ckbox[" + idx + "].checked"== true) {

total 
+= 1;

}

}

alert(
"你选择了 " + total + " 个选项.");

}

// End -->

</script>

<form method="post" name=playlist>

1<input type=checkbox name=ckbox>

2<input type=checkbox name=ckbox>

3<input type=checkbox name=ckbox>

4<input type=checkbox name=ckbox>

5<input type=checkbox name=ckbox>

6<input type=checkbox name=ckbox>

7<input type=checkbox name=ckbox>

8<input type=checkbox name=ckbox>

9<input type=checkbox name=ckbox>

<p><center><input type=button value="检测选择个数" onClick="anyCheck(this.form)">

</center></form>
posted on 2008-06-17 14:42 Hank1026 阅读(491) 评论(0)  编辑  收藏 所属分类: 每日积累

只有注册用户登录后才能发表评论。


网站导航: