<form name=theForm>
<select name=s020 onchange="if (theForm.s020.options[theForm.s020.selectedIndex].value=='a') { theForm.s020_99.value=''; theForm.s020_99.disabled=true;} else theForm.s020_99.disabled=false;">
<option value="a">a</option>
<option value="b">b</option>
</select>
<input name="s020_99">
</form>
<select name=s020 onchange="if (theForm.s020.options[theForm.s020.selectedIndex].value=='a') { theForm.s020_99.value=''; theForm.s020_99.disabled=true;} else theForm.s020_99.disabled=false;">
<option value="a">a</option>
<option value="b">b</option>
</select>
<input name="s020_99">
</form>
解决方案 »
- JS 跨域 ajax js嵌套 新手问题
- javascript 如何判断capslock键是否开启?
- 没有onMouseOver onMouseOut onclick 这个菜单是怎么触发的?
- 《javascript高级程序设计》第六章一个问题~在线求教。谢谢
- 字符串处理!
- onbeforeunload问题,在提交确定后执行事件,点击取消不执行事件,高手帮忙
- jquery ajax在360极速浏览器下的问题
- js文件转换成htc问题
- 简单任务,快来完成啊………… 有奖赏的 100分哪……
- 请教:如何定制文件选择框?
- 一个Array随机排序的脚本,理论上是完全随机的,但不知道搞什么贵,实际上却不是。
- 请问怎样做一个产品的树型目录?
{
if (checkboxNever.checked == true)
{
document.all.DownloadTexts.style.color = "inactivecaption";
document.all.downloadButtonbox.style.display = "none";
document.all.OKButton.style.display = "";
}
else
{
document.all.DownloadTexts.style.color = "buttontext";
document.all.downloadButtonbox.style.display = "";
document.all.OKButton.style.display = "none";
}
}
<!--
function on_selected(theID) {
switch(theID){
case "o1":
document.form1.t1.style.display="none";
break;
case "o2":
document.form1.t2.style.display="none";
break;
case "o3":
document.form1.t3.style.display="none";
break;
case "o4":
document.form1.t4.style.display="none";
break;
default:
}
}
//-->
</script><form id="form1" name="form1">
<select name="select1" id="select1" onchange="on_selected(this.value)">
<option>请选择</option>
<option name="o1" id="o1" value="o1">1</option>
<option name="o2" id="o1" value="o2">2</option>
<option name="o3" id="o3" value="o3">3</option>
<option name="o4" id="o4" value="o4">4</option>
</select>
<br>
<input name="t1" id="t1" value="t1" style="display:true;"><br>
<input name="t2" id="t2" value="t2" style="display:true;"><br>
<input name="t3" id="t3" value="t3" style="display:true;"><br>
<input name="t4" id="t4" value="t4" style="display:true;"><br>
</form>
请教各位大虾,我现在想在下拉选项(s020)中增加一个选项为“其他”当未选中“其他”时,下面的文本框不可选,当选中其他时,该文本框可填写(s020_99)。
SOS!老板急着要,我对javascript又不熟,救救我吧!!!!
<select name=s020 onchange="if (theForm.s020.options[theForm.s020.selectedIndex].value=='其他') { theForm.s020_99.value=''; theForm.s020_99.disabled=false;} else theForm.s020_99.disabled=true;">
<option value="a">a</option>
<option value="b">b</option>
<option value="其他">其他</option>
</select>
<input name="s020_99">
</form>
<select name=s020 onchange="if (theForm.s020.options[theForm.s020.selectedIndex].value=='其他') { theForm.s020_99.value=''; theForm.s020_99.disabled=false;} else theForm.s020_99.disabled=true;">
<option value="a">a</option>
<option value="b">b</option>
<option value="其他">其他</option>
</select>
<input name="s020_99">
</form>
<form name=theForm>
<select name=s020 onchange="if (theForm.s020.options[theForm.s020.selectedIndex].value=='其他') { theForm.s020_99.value=''; theForm.s020_99.disabled=false;} else theForm.s020_99.disabled=true;">
<option value="a">a</option>
<option value="b">b</option>
<option value="其他">其他</option>
</select>
<input name="s020_99">
</form>
<select name=s020 onchange="if (theForm.s020.options[theForm.s020.selectedIndex].value=='其他') { theForm.s020_99.value=''; theForm.s020_99.disabled=true;} else theForm.s020_99.disabled=false;">
<option value="其他">其他</option>
<option value="a">a</option>
<option value="b">b</option>
</select>
<input name="s020_99">
</form>