asp表单单选 文本 提交

来源:百度知道 编辑:UC知道 时间:2024/06/05 19:38:09
比如有2个单选按钮 1个文本框
单选按钮(一个值是a 一个值是b)

我要让单选到a值时,文本框里的内容 传输到a.asp
我要让单选到b值时,文本框里的内容 传输到b.asp
其实a.asp b.asp是我已经做好的搜索页面。

这样就可以了
<input type="radio" value="a" checked onclick="location.href='a.asp?t='+text1.value" />
a.asp<br />
<input type="radio" value="b" onclick="location.href='b.asp?t='+text1.value" />
b.asp <br />
<input type="text" name="text1" value=""/>

单选按钮若命名为s_type 文本框命名为keyword
<%
s_type=request("s_type")
keyword=request("keyword")
if keyword="" then
response.redirect"现在的页面.asp"
end if
if s_type="a" then
set rs=server.createobject("ADODB.Recordset")
sql="select * from 表 where 搜索字段名 like'%"&keyword&"%'"
rs.open sql,conn,3,3
if not rs.eof then
response.redirect"a.asp"
end if
rs.close
set rs=nothing
'备注:在a.asp页面直接写<%=ke