62,046
社区成员
发帖
与我相关
我的任务
分享
<script Language="JavaScript">
function check(oCheck)
{
var arr=new Array();
for(var i=1;i<=8;i++)
{
if(oCheck.id.replace('chk','')<7&&oCheck.checked&&i>6)
{
document.getElementById("chk"+i).checked=false;
document.getElementById("chk"+i).disabled=true;
}
if(oCheck.id.replace('chk','')>6&&oCheck.checked&&i<7)
{
document.getElementById("chk"+i).checked=false;
document.getElementById("chk"+i).disabled=true;
}
if(document.getElementById("chk"+i).checked)
{
arr.push(i);
}
}
if(arr.length==0)
{
reload();
}
}
function reload()
{
for(var i=1;i<=8;i++)
{
document.getElementById("chk"+i).checked=false;
document.getElementById("chk"+i).disabled=false;
}
}
</script>
<form name="forms" method="post">
<input type="checkbox" id="chk1" onclick="check(this)"/>
<input type="checkbox" id="chk2" onclick="check(this)"/>
<input type="checkbox" id="chk3" onclick="check(this)"/>
<input type="checkbox" id="chk4" onclick="check(this)"/>
<input type="checkbox" id="chk5" onclick="check(this)"/>
<input type="checkbox" id="chk6" onclick="check(this)"/>
<input type="checkbox" id="chk7" onclick="check(this)"/>
<input type="checkbox" id="chk8" onclick="check(this)"/>
<input type="button" value="reset" onclick="reload();" />
</form>