asp 获取下拉框的值的问题?为什么不获得下拉框的值呢?
<html><head><title>retrieveinformationfromformcontrols(radio,checkbox,select)</title>...
<html>
<head>
<title>retrieve information from form controls(radio, checkbox, select) </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<table>
<form name="form1" method="post" action="choose.asp" enctype="multipart/form-data" onSubmit="checkFileUpload(this,'GIF,JPG,JPEG');return document.MM_returnValue">
<tr bgcolor="#f1f3f5">
<td><div align="right">选择年度: </div></td>
<td>
<select name="aYear" id="aYear">
<option selected="selected" value="2012">年度</option>
<option value="2012" >2012 </option>
<option value="2013">2013 </option>
<option value="2014">2014 </option>
</select>
</td> </tr>
<tr bgcolor="#f1f3f5">
<td height="26" colspan="2"><div align="center">
<input name="Submit" type="submit" class="button" value="确 定 提 交" style="width=130px;height=30px;font-size=12px">
</div></td>
</tr>
</form>
</table>
你选择了:<br>
<%
'aa=Request.querystring("ayear")
Response.Write(Request.querystring("ayear"))
%>
</body>
</html> 展开
<head>
<title>retrieve information from form controls(radio, checkbox, select) </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<table>
<form name="form1" method="post" action="choose.asp" enctype="multipart/form-data" onSubmit="checkFileUpload(this,'GIF,JPG,JPEG');return document.MM_returnValue">
<tr bgcolor="#f1f3f5">
<td><div align="right">选择年度: </div></td>
<td>
<select name="aYear" id="aYear">
<option selected="selected" value="2012">年度</option>
<option value="2012" >2012 </option>
<option value="2013">2013 </option>
<option value="2014">2014 </option>
</select>
</td> </tr>
<tr bgcolor="#f1f3f5">
<td height="26" colspan="2"><div align="center">
<input name="Submit" type="submit" class="button" value="确 定 提 交" style="width=130px;height=30px;font-size=12px">
</div></td>
</tr>
</form>
</table>
你选择了:<br>
<%
'aa=Request.querystring("ayear")
Response.Write(Request.querystring("ayear"))
%>
</body>
</html> 展开
2个回答
展开全部
你好,您这个问题是因为你这种写法是不支持静态刷新,我修改了一下,可以实现您这个功能,如果有问题再联系我!
<html>
<head>
<title>retrieve information from form controls(radio, checkbox, select) </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<table>
<form name="form1" method="post" action="choose.asp" enctype="multipart/form-data" onSubmit="checkFileUpload(this,'GIF,JPG,JPEG');return document.MM_returnValue">
<tr bgcolor="#f1f3f5">
<td><div align="right">选择年度: </div></td>
<td>
<select name="aYear" id="aYear" onchange="window.location=this.value;">
<option selected="selected" value="2012">年度</option>
<OPTION value="?ayear=2012">2012 </option>
<option value="?ayear=2013">2013 </option>
<option value="?ayear=2014">2014 </option>
</select>
</td> </tr>
<tr bgcolor="#f1f3f5">
<td height="26" colspan="2"><div align="center">
<input name="Submit" type="submit" class="button" value="确 定 提 交" style="width=130px;height=30px;font-size=12px">
</div></td>
</tr>
</form>
</table>
你选择了:<br>
<%
'aa=Request.querystring("ayear")
Response.Write(Request.querystring("ayear"))
%>
</body>
</html>
<html>
<head>
<title>retrieve information from form controls(radio, checkbox, select) </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<table>
<form name="form1" method="post" action="choose.asp" enctype="multipart/form-data" onSubmit="checkFileUpload(this,'GIF,JPG,JPEG');return document.MM_returnValue">
<tr bgcolor="#f1f3f5">
<td><div align="right">选择年度: </div></td>
<td>
<select name="aYear" id="aYear" onchange="window.location=this.value;">
<option selected="selected" value="2012">年度</option>
<OPTION value="?ayear=2012">2012 </option>
<option value="?ayear=2013">2013 </option>
<option value="?ayear=2014">2014 </option>
</select>
</td> </tr>
<tr bgcolor="#f1f3f5">
<td height="26" colspan="2"><div align="center">
<input name="Submit" type="submit" class="button" value="确 定 提 交" style="width=130px;height=30px;font-size=12px">
</div></td>
</tr>
</form>
</table>
你选择了:<br>
<%
'aa=Request.querystring("ayear")
Response.Write(Request.querystring("ayear"))
%>
</body>
</html>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询