asp表单传值提交问题??
<formid="form1"name="form1"method="post"action="123.asp?id="<%=rs("id")%>><selectname...
<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 展开
<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 展开
1个回答
展开全部
<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>
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>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询