asp表单传值提交问题??

来源:百度知道 编辑:UC知道 时间:2024/06/24 12:36:09
<form id="form1" name="form1" method="post" action="123.asp?id="<%=rs("id")%>>
<select name="id" size="1">
<%
sql="select * from 123"
set rs=conn.execute(sql)
do while not rs.eof %>
<option value="<%=rs("id")%>" selected="selected"><%=rs("123")%></option>
<% rs.movenext
loop
%>
</select>
<input type="submit" name="Submit" value="提交" />
</form>
请问各位高手,根据选择的不同所提交的action="123.asp?id="<%=rs("id")%>>值也不同??这应该怎样实现??
如:选择1 那么action="123.asp?id=1
选择2 那么action="123.asp?id=2

<script>
function ac(){
selectindex = document.getElementById("s").selectedIndex;
idvalue = (document.getElementById("s").options[selectindex].value);
document.getElementById("f").action = "abc.asp?id="+idvalue;
}
</script>
<form id="f" action="abc.asp?id=1" target="_blank" method="post">
<select id="s" onchange="ac()">
<option value="1">项目1</option>
<option value="2">项目2</option>
<option value="3">项目3</option>
</select>
<input type="submit" value="提交" />
</form>