asp语句的问题

来源:百度知道 编辑:UC知道 时间:2024/05/23 10:25:43
<select name="quhao " >
<option value="city2" selected>2区 </option>
<option value="city4">4区 </option>
</select>

<% response.Write(request.Form("quhao")) %>
怎么才能让输出的值为单选里的值
我的想法是把值city2或者city4赋给quhao
但以上情况输出的竟然是空白

<select name="quhao " > 改成 <select name="quhao" >

因为你多个空格

<%result=request("quhao")if result="city2" then a="2"if result="city4" then a="4"response.write a

<select name="quhao " >
<option value="city2" selected>2区 </option>
<option value="city4">4区 </option>
</select>
-------------------------------------------
<% area=request.Form("quhao")%>
<% response.Write area %>

晕,先获取quhao的值阿。
用语句
<% quhao=request("quhao")%>
上面的意思是把表单quhao的值赋予quhao变量
接着呢!我们就能获得用户选取的那个option value
然后用
<% response.Write quhao%>