<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 閱讀(501)
評論(0) 編輯 收藏 所屬分類:
每日積累