当前位置: 代码迷 >> ASP >> 怎样使下拉列表提交后显示所选项解决方法
  详细解决方案

怎样使下拉列表提交后显示所选项解决方法

热度:84   发布时间:2012-03-31 13:13:26.0
怎样使下拉列表提交后显示所选项
从下拉列表中选择一项再点提交后下拉列表显示的一直是第一项,怎样让他显示选的那项?

------解决方案--------------------
<%
sel = request.form( "sel ")
if sel = " " then sel = "1 "
%>
<form action= "post ">
<select id= "sel " name= "sel ">
<option value= "1 " <%if sel = "1 " then response.write "selected "%> > 1 </option>
<option value= "2 " <%if sel = "2 " then response.write "selected "%> > 2 </option>
<option value= "3 " <%if sel = "3 " then response.write "selected "%> > 3 </option>
</select>
<input type= "submit " value= "submit ">
</form>

===================
未验证,自己测试
  相关解决方案