<script language="javascript">function ChgStatus(n){
switch(n)
{
case 1:
for(i=1;i<5;i++)
{
eval("opcontent"+i+".checked=false")
eval("opcontent"+i+".disabled=true")
}
for(i=5;i<9;i++)
{
eval("opcontent"+i+".disabled=false")
}
break;case 2:
for(i=1;i<5;i++)
{
eval("opcontent"+i+".disabled=false")
}
for(i=5;i<9;i++)
{
eval("opcontent"+i+".checked=false")
eval("opcontent"+i+".disabled=true")
}
break;case 3:
for(i=1;i<9;i++)
{
eval("opcontent"+i+".checked=false")
eval("opcontent"+i+".disabled=true")
}break;
}
}</script>
<input type="radio" class="radio" size="10" name="cfcf" id="cfyou" onclick="ChgStatus(1);"></input>
<input type="checkbox" class="checkbox" name="opcontent1" value="1" id="opcontent">
<input type="checkbox" class="checkbox" name="opcontent2" value="2" id="opcontent">
<input type="checkbox" class="checkbox" name="opcontent3" value="3" id="opcontent">
<input type="checkbox" class="checkbox" name="opcontent4" value="4" id="opcontent"><input type="radio" class="radio" size="10" name="cfcf" id="cfwu" onclick="ChgStatus(2);"></input><input type="checkbox" class="checkbox" name="opcontent5" value="5" id="opcontent">
<input type="checkbox" class="checkbox" name="opcontent6" value="6" id="opcontent">
<input type="checkbox" class="checkbox" name="opcontent7" value="7" id="opcontent">
<input type="checkbox" class="checkbox" name="opcontent8" value="8" id="opcontent"><input type="radio" class="radio" size="10" name="cfcf" id="cfwu" onclick="ChgStatus(3);"></input>
switch(n)
{
case 1:
for(i=1;i<5;i++)
{
eval("opcontent"+i+".checked=false")
eval("opcontent"+i+".disabled=true")
}
for(i=5;i<9;i++)
{
eval("opcontent"+i+".disabled=false")
}
break;case 2:
for(i=1;i<5;i++)
{
eval("opcontent"+i+".disabled=false")
}
for(i=5;i<9;i++)
{
eval("opcontent"+i+".checked=false")
eval("opcontent"+i+".disabled=true")
}
break;case 3:
for(i=1;i<9;i++)
{
eval("opcontent"+i+".checked=false")
eval("opcontent"+i+".disabled=true")
}break;
}
}</script>
<input type="radio" class="radio" size="10" name="cfcf" id="cfyou" onclick="ChgStatus(1);"></input>
<input type="checkbox" class="checkbox" name="opcontent1" value="1" id="opcontent">
<input type="checkbox" class="checkbox" name="opcontent2" value="2" id="opcontent">
<input type="checkbox" class="checkbox" name="opcontent3" value="3" id="opcontent">
<input type="checkbox" class="checkbox" name="opcontent4" value="4" id="opcontent"><input type="radio" class="radio" size="10" name="cfcf" id="cfwu" onclick="ChgStatus(2);"></input><input type="checkbox" class="checkbox" name="opcontent5" value="5" id="opcontent">
<input type="checkbox" class="checkbox" name="opcontent6" value="6" id="opcontent">
<input type="checkbox" class="checkbox" name="opcontent7" value="7" id="opcontent">
<input type="checkbox" class="checkbox" name="opcontent8" value="8" id="opcontent"><input type="radio" class="radio" size="10" name="cfcf" id="cfwu" onclick="ChgStatus(3);"></input>
解决方案 »
- 火狐下jq ajax访问json文件返回[object XMLDocument] google,ie正常数据,求解?
- Easyui datagrid 如何取返回的参数
- 鼠标经过弹出菜单问题,CSDN这个不错啊。但是我找不到他的源码。
- 用setTimeout做图片循环,一直刷新图片,有什么办法可以解决?
- javascript得到鼠标坐标的问题
- 为什么我加了src=**.js会报有错误
- 一个页面转向另一个页面的问题!
- 关于回车换行的小问题
- 怎么做到在客户端显示动态添加的文本框?
- 小白求助一个判断位置是否在区域的代码问题!
- 关于框架的问题
- 用javascript打开一个新窗口,怎么让它显示滚动条?另外我想让一个窗口分成三桢怎么做?
** 第一个参数为要disabled的checkbox的name,如果为多个用,隔开
** 第二个参数为要enabled的checkbox的name,如果多个用,隔开
*/
function ChgStatus(el){
elArr = el.split(",");
for(i=0;i<elArr.length;i++)
{
var op = document.getElementsByName(elArr[i]);
for(j=0;j<op.length;j++)
{
op[j].checked = false;
op[j].disabled = true;
}
}
if(arguments.length >1 )
{
elArr = arguments[1].split(",");
for(i=0;i<elArr.length;i++)
{
var op = document.getElementsByName(elArr[i]);
for(j=0;j<op.length;j++)
{
op[j].checked = false;
op[j].disabled = false;
}
}
}
}</script>
<input type="radio" class="radio" size="10" name="cfcf" id="cfyou" onclick="ChgStatus('op1','op2');"></input>
<input type="checkbox" class="checkbox" name="op1" value="1">
<input type="checkbox" class="checkbox" name="op1" value="2">
<input type="checkbox" class="checkbox" name="op1" value="3">
<input type="checkbox" class="checkbox" name="op1" value="4">
<input type="radio" class="radio" size="10" name="cfcf" id="cfwu" onclick="ChgStatus('op2','op1');"></input>
<input type="checkbox" class="checkbox" name="op2" value="5">
<input type="checkbox" class="checkbox" name="op2" value="6">
<input type="checkbox" class="checkbox" name="op2" value="7">
<input type="checkbox" class="checkbox" name="op2" value="8">
<input type="radio" class="radio" size="10" name="cfcf" id="cfwu" onclick="ChgStatus('op1,op2');"></input>
循环加选择,执行应该更耗资源吧如果把所有的checkbox改称统一的名字,怎样识别呢?