根据SELECT的选择,显示文本框。

simon803 2013-11-05 05:22:31
1、
<select name="zt" id="zt">
<option value="0" <%if zt="0" then%> selected="selected"<%end if%>>AAAAA</option>
<option value="1" <%if zt="1" then%> selected="selected"<%end if%>>BBBBB</option>
<option value="2" <%if zt="2" then%> selected="selected"<%end if%>>CCCCC</option>
<option value="3" <%if zt="3" then%> selected="selected"<%end if%>>DDDDD</option>
<option value="4" <%if zt="4" then%> selected="selected"<%end if%>>EEEEE</option>
</select>
<input name="truename" id="id" value="" />

我需要选择CCCCC的时候,<input name="truename" id="id" value="" />文本框显示出来。
其他时候都是隐藏的。

2、ASP的长度是这样判断吗?
if len(sfz)<15 or len(username)>18 then
response.Write("身份证号码输入错误")
response.redirect(request.ServerVariables("HTTP_REFERER"))
end if
...全文
441 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
Go 旅城通票 2013-11-06
  • 打赏
  • 举报
回复
<select name="zt" id="zt" onchange="document.getElementById('id').style.display=this.value=='2'?'block':'none'"> <option value="0" <%if zt="0" then%> selected="selected"<%end if%>>AAAAA</option> <option value="1" <%if zt="1" then%> selected="selected"<%end if%>>BBBBB</option> <option value="2" <%if zt="2" then%> selected="selected"<%end if%>>CCCCC</option> <option value="3" <%if zt="3" then%> selected="selected"<%end if%>>DDDDD</option> <option value="4" <%if zt="4" then%> selected="selected"<%end if%>>EEEEE</option> </select> <input name="truename" id="id" value="" />
big_shot 2013-11-06
  • 打赏
  • 举报
回复
document.getElementById("id").style.display="none"隐藏 document.getElementById("id").style.display="block"显示
  • 打赏
  • 举报
回复
引用 3 楼 simon803 的回复:
不对 。。 应该是JS判断 。 我需要的效果是当下拉选择CCCCC时,显示文本框 。
JS的这个网站就更多的例子了 就是使用document.getElementById("id").style.display="none"隐藏 document.getElementById("id").style.display="block"显示
simon803 2013-11-06
  • 打赏
  • 举报
回复
不对 。。 应该是JS判断 。 我需要的效果是当下拉选择CCCCC时,显示文本框 。
  • 打赏
  • 举报
回复
引用 楼主 simon803 的回复:
1、 <select name="zt" id="zt"> <option value="0" <%if zt="0" then%> selected="selected"<%end if%>>AAAAA</option> <option value="1" <%if zt="1" then%> selected="selected"<%end if%>>BBBBB</option> <option value="2" <%if zt="2" then%> selected="selected"<%end if%>>CCCCC</option> <option value="3" <%if zt="3" then%> selected="selected"<%end if%>>DDDDD</option> <option value="4" <%if zt="4" then%> selected="selected"<%end if%>>EEEEE</option> </select> <input name="truename" id="id" value="" /> 我需要选择CCCCC的时候,<input name="truename" id="id" value="" />文本框显示出来。 其他时候都是隐藏的。 2、ASP的长度是这样判断吗? if len(sfz)<15 or len(username)>18 then response.Write("身份证号码输入错误") response.redirect(request.ServerVariables("HTTP_REFERER")) end if
这个判断是对的,只是前后的变量名不统一,这个应该是写错了吧
  • 打赏
  • 举报
回复
<select name="zt" id="zt"> <option value="0" <%if zt="0" then%> selected="selected"<%end if%>>AAAAA</option> <option value="1" <%if zt="1" then%> selected="selected"<%end if%>>BBBBB</option> <option value="2" <%if zt="2" then%> selected="selected"<%end if%>>CCCCC</option> <option value="3" <%if zt="3" then%> selected="selected"<%end if%>>DDDDD</option> <option value="4" <%if zt="4" then%> selected="selected"<%end if%>>EEEEE</option> </select> <input name="truename" id="id" value="" <%if zt<>"2" then%>style="display:none"<%end if%> />

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧