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

下拉框选项改变,怎么展开其它input项
我做一个form。当一个下拉框选项为一个特定值时,需要用户填写特定信息,就是要展开一些特定input项,下拉框不为此值时,收起这些选项,怎么实现?

------解决方案--------------------
放在 <div> 中,然后用js来控制
------解决方案--------------------
<select onchange= "if(this.value!=某值){document.getElementById( 's ').style.display= 'none ';}else{document.getElementById( 's ').style.display= ' ';} ">
.....
</select>


<div id= "s ">
<input type= "text " />
<input type= "text " />
<input type= "text " />
<input type= "text " />
</div>
------解决方案--------------------
<select onchange= "show(this); ">
....
</select>
<script>
function show(object)
{
document.getElementById( 's ').style.display = ( object.value == "某个值 " ? "block " : "none ");
}
</script>
<div id= "s ">
<input type= "text " />
<input type= "text " />
<input type= "text " />
<input type= "text " />
</div>
------解决方案--------------------
demp.asp
<%ss=request.querystring( "sss ")%>
<form name=... method=... action=...>
<select...... onChange= "reOpen(this) "> .... </select>
<%if ss=特定的值 then%>
<input type=...>
...
<%end if%>
<script language=vbscript>
sub reopen(t)
location.assign( "demo.asp?sss= " & t.value)
end sub
</script>