Mar
17

js判断复选框checkbox数组是否被选中     2009

 11:22    1720    0   noel 程序 代码 源码 不指定 | |
js判断复选框checkbox数组是否被选中



<script>
function test()
{
var x=document.getElementsByName("enjoy[]");
var issel=false;
for(var i=0;i<x.length;i++)
{
if(x[i].checked)
{
issel=true;
return issel;
}
}
return issel;
}
</script>
<body>
<form id="form1" name="form1" method="post" action="">

<input type="checkbox" name="enjoy[]" id="enjoy[]" />

<input type="checkbox" name="enjoy[]" id="enjoy[]" />


<input type="submit" name="button" id="button" onclick="alert(test());" value="提交" />
</form>

作者:noel@淘宝网女装新款秋装连衣裙裤子外套上衣_2012时尚女装新款 Ecmall二次开发-PHP技术
地址:http://www.laohucheng.com/post/129/
版权所有©转载时必须以链接形式注明作者和原始出处及本声明!

Tags: , , 引用(0)
发表评论
昵称 [注册]
密码 游客无需密码
网址
电邮
打开HTML 打开UBB 打开表情 隐藏 记住我