第一个下拉列表框中有两个选项,选择不同的选项使第二个下拉框变的可用或是不可用这样的JS应该怎么写啊?
解决方案 »
- 网页播放视频问题
- 帮忙看下有语法错误么?
- 问一下,我要在后台得到下拉列表里的值怎么获得?
- 急死了~~~~~~~!!!救命啊!!!
- 怎样才能在JSP文件里面,使用response.getOutputStream()来输入?????
- 请问有什么办法可以将网页上的后退和前进按钮禁止?
- 出现新问题:原因: 未与信任 SQL Server 连接相关联。
- 有关接收复合邮件的问题,怎样才能把背景图片显示出来。
- jsp与Javabean通讯问题
- spring afterPropertiesSet执行修改sql无效
- 怎样回速掌握struts,spring,hibernate?
- tomat下部署工程相对路径的问题,在线等, 立刻结帖!!
document.getElementById(".....").disabled=false;
document.form1.checkbox2.disabled=true;
}
function gray() {
var a = document.getElementById("restricted").value; if (a != 0) { document.all.terminalid.disabled = false;
document.all.terminalid.style.backgroundColor = '#ffffff';
} else {
document.all.terminalid.disabled = true;
document.all.terminalid.style.backgroundColor = '#cccccc';
}
}不过有问题,有时候得选择几次后才会产生输入框变灰的效果 ...
var next = document.getElementById("operate");
//alert('=====disable'+cselopetions.length);
for(var i = 0; i<cselopetions.length ;i++){
if("disable"==cselopetions[i].value&&cselopetions[i].selected){
next.disabled=true;
}
if("enable"==cselopetions[i].value&&cselopetions[i].selected){
next.disabled=false;
}
}
} <select id="controlsel" onchange="changesel(this)">
<option>select</option>
<option value="enable" >enable</option>
<option value="disable">disable</option>
</select>
<select id="operate">
<option>aa</option>
<option>bb</option>
</select>
<head><title>无标题文档</title>
<script type="text/javascript">
function change(obj)
{
if(obj.value=="false")
{
document.getElementById("select2").disabled=true;
}
else
{
document.getElementById("select2").disabled=false;
}
}
</script>
</head><body>
<select id="select1" onchange="change(this)" >
<option value="true">true</option>
<option value="false">false</option>
</select><select id="select2" >
</select>
</body>
</html>