<script type="text/javascript">
//<![CDATA[
function webchose(webstr)
{
var a=webstr.split(/\s*,\s*/);
for(var i=0, j=a.length; i<j; i++)
{
document.getElementById(a[i]).checked=true;
}
} // shawl.qiu script
//]]>
</script>
<form name=webform action="" method=post>
<table border="0" width="100%" id="table2">
<tr>
<td><input type=checkbox name="WebId" id="W1" value="1">dataa</td>
<td><input type=checkbox name="WebId" id="W21" value="21">datab</td>
<td><input type=checkbox name="WebId" id="W3" value="3">datac</td>
<td><input type=checkbox name="WebId" id="W4" value="4">datad</td>
<td><input type=checkbox name="WebId" id="W25" value="25">datae</td>
<td><input type=checkbox name="WebId" id="W6" value="6">dataf</td>
<td><input type=checkbox name="WebId" id="W7" value="7">datag</td>
<td><input type=checkbox name="WebId" id="W8" value="8">datah</td>
</tr>
</table>
<input type=button value="选定" onclick="webchose('W1,W4,W7');">
</form>
//<![CDATA[
function webchose(webstr)
{
var a=webstr.split(/\s*,\s*/);
for(var i=0, j=a.length; i<j; i++)
{
document.getElementById(a[i]).checked=true;
}
} // shawl.qiu script
//]]>
</script>
<form name=webform action="" method=post>
<table border="0" width="100%" id="table2">
<tr>
<td><input type=checkbox name="WebId" id="W1" value="1">dataa</td>
<td><input type=checkbox name="WebId" id="W21" value="21">datab</td>
<td><input type=checkbox name="WebId" id="W3" value="3">datac</td>
<td><input type=checkbox name="WebId" id="W4" value="4">datad</td>
<td><input type=checkbox name="WebId" id="W25" value="25">datae</td>
<td><input type=checkbox name="WebId" id="W6" value="6">dataf</td>
<td><input type=checkbox name="WebId" id="W7" value="7">datag</td>
<td><input type=checkbox name="WebId" id="W8" value="8">datah</td>
</tr>
</table>
<input type=button value="选定" onclick="webchose('W1,W4,W7');">
</form>
解决方案 »
- highcharts的设置,求指教
- !!请问这是什么编码,怎么应用,立即给分
- 超链接防止重复提交(并非简单按钮防止重复提交)
- <script language='javascript'>window.location.href = './aaa/index.htm'</script>为什么在2000系统下不执行
- javascript的数组的下标是不是以0开头,我从两本资料看得弄糊涂了!!
- 请问如何用程序关闭alert("ok")窗口?
- 再问下拉框问题(可能是字符集的问题)--数据库为Oracle
- function getNewBehavior() 怎样与相关的事件联系起来?
- 两个小问题!!!!!!
- STRUTS2标签能否用EXT日期控件
- 一个关于JS控制播放器的进度条和声音条的问题
- 能否在Firefox title属性内的实现回车
我自己写的时候,这句话写不了document.getElementById(a[i]).checked=true;
<!--
function webchose(webstr)
{
window.document.webform.WebId1.checked=true;
window.document.webform.WebId2.checked=true;
window.document.webform.WebId3.checked=true;
return false;
}
//-->
</script>
</head>
<body>
<form name=webform action="" method=post>
<table border="0" width="100%" id="table2">
<tr>
<td><input type=checkbox name="WebId1" id="W1" value="1">dataa</td>
<td><input type=checkbox name="WebId2" id="W21" value="21">datab</td>
<td><input type=checkbox name="WebId3" id="W3" value="3">datac</td>
<td><input type=checkbox name="WebId4" id="W4" value="4">datad</td>
<td><input type=checkbox name="WebId5" id="W25" value="25">datae</td>
<td><input type=checkbox name="WebId6" id="W6" value="6">dataf</td>
<td><input type=checkbox name="WebId7" id="W7" value="7">datag</td>
<td><input type=checkbox name="WebId8" id="W8" value="8">datah</td>
</tr>
</table>
<input type=button value="选定" onclick="webchose('W1,W4,W7');">
自己修改一下吧!