日期:2014-05-17  浏览次数:20948 次

怎么让了下拉框在他之前的单选按钮末选中之前为不可用,在选中之后为可用!!
怎么让了下拉框在他之前的单选按钮末选中之前为不可用,在选中之后为可用!!

高手指点一下..谢谢!

------解决方案--------------------
<script type= "text/javascript ">
function c(obj)
{
if (obj.checked)
{
var o = document.getElementsByTagName( "select ");
for (var i = 0; i < o.length; i++)
{
o[i].disabled = true;
}
obj.nextSibling.nextSibling.disabled = false;
}
}
</script>
<input type= "radio " name= "a " onclick= "c(this) ">
<select disabled>
<option>
<option>
</select>
<br>
<input type= "radio " name= "a " onclick= "c(this) ">
<select disabled>
<option>
<option>
</select>

------解决方案--------------------
点中checkbox的时候select就可用,取消选择select就不可用

<form>
<input type= "checkbox " onclick= "if(this.checked){this.form.slt.disabled=false}else(this.form.slt.disabled=true) ">
<select disabled id= "slt ">
<option> aaa </option>
<option> bbb </option>
</select>
</form>