JS判断点击行为而显示相应状态
<script language=javascript type=text/javascript>
function mycheck(){
var obj = document.getElementById("throwSite");
if(obj.checked == true){///被选中了
document.getElementById("throwSiteAreaAll").disabled=false;
document.getElementById("throwSiteAreaSome").disabled=false;
}
if(obj.checked == false){/// 取消选中
document.getElementById("throwSiteAreaAll").disabled=true;
document.getElementById("throwSiteAreaSome").disabled=true;
document.getElementById("throwSiteAreaAll").checked=false;
document.getElementById("throwSiteAreaSome").checked=false;
other1.style.display="none";
}
}
function myselects(i){
switch(i){
case 1:
other1.style.display="none";
break;
case 0:
other1.style.display="block";
break;
}
}
</script>
<body onload="mycheck();">
<table border="0" width="100%" cellspacing="1" height="100%">
<tr>
<td> <input type="checkbox" name="throwSite" id="throwSite" value="1" onclick="mycheck();">内容网络</td>
</tr>
<tr>
<td style="padding-left:25px;"><input type="radio" value="0" name="throwSiteArea" id="throwSiteAreaAll" onclick="myselects(1); "> 整个网络上的相关网页</td>
</tr>
<tr>
<td style="padding-left:25px;"><input type="radio" value="1" name="throwSiteArea" id="throwSiteAreaSome" onclick="myselects(0); "> 仅我定位的展示位置上的相关网页
<div id="other1" style="DISPLAY:none"><textarea rows="6" name="throwSiteAreaSomeList" cols="35"></textarea></div></td>
</tr>
</table>