|
|
|
|
|
var i
for(i=0;i<form1.checkbox1.length;i++) { form1.checkbox1(i).checked } |
|
|
<script language="Javascript">
function selAudio(isTrue) { var i,obj; i=0; while(true) { obj=eval("document.form1.ids"+(++i)); if(!obj)break; obj.checked=isTrue; } } } </script> <form1 name="form1"> <%for i=1 to 10%> <input type="checkbox" name="UserID" value="<%=i%>" id="ids<%=i%>"> <%next%> <input type="button" value="全选" onClick="selAudio(true);" class="button"> </form1> |
|
|
<SCRIPT LANGUAGE="JavaScript">
<!-- function selectall_onclick(value,n) { var chk; chk = eval("document.frmform.chkbox"+n); if ((chk.length)>1 ) { for (var i=0;i< chk.length;i++) { chk[i].checked=value } } else { chk.checked=value } } //--> </SCRIPT> <form name=frmform ……> <input type=checkbox name=chkbox0 value=1>test1 <input type=checkbox name=chkbox0 value=1>test2 <input type=checkbox name=chkbox0 value=1>test3 <input type=checkbox name=chkbox0 value=1><BR> <input type=checkbox name=selectall0 onclick="javascript:selectall_onclick(frmform.selectall0.checked,0)"> 选中所有 </form> |
|