请教-关于单选按钮组的问题-大家帮忙看看是什么问题
大家帮忙这段代码哪里错了!
<!--#include virtual="/easp/conn.asp" -->
<body>
<form id="form2" name="form2" method="post" action="单选按钮组.asp">
<p>
<label>
<input type="radio" name="an" value="1" id="an_0" />
1</label>
<br />
<label>
<input type="radio" name="an" value="2" id="an_1" />
2</label>
<br />
<label>
<input type="radio" name="an" value="3" id="an_2" />
3</label>
<br />
<br />
</p>
<input type="hidden" value="act" name="act" />
<input type="submit" name="button" id="button" value="提交" />
</form>
<%
if request.Form("act")="act" then
dim rs,sql,an,val
an=request.Form("an")
response.Write an
set rs = Server.CreateObject("ADODB.RecordSet")
sql="select * from 单选按钮 "
rs.open sql,conn,3,3
%>
<%if rs.EOF and rs.BOF then
response.write ("没数据")
else
%>
<form id="form1" name="form1" method="post" action="">
<%while not rs.eof%>
<%=rs("val")%>
<label>
<input type="radio" name="ann" value="<%=rs("val")%>" <%if rs("val")=an then%>checked="checked"<%end if%> />
<%=rs("no")%>
</label>
<br />
<%
rs.MoveNext()
wend
end if
%>
</form>
<%
rs.close
set rs=Nothing
end if
%>
(Access)数据表“单选按钮” 有 字段“val”和“no”,有3条记录,记录值分别是1、2、3
现在我想当在form2里的单选按钮组选择了1,提交到form1时,rs("val")的值等于接收到form2的值的时候,form1里的那个单选按钮就被选中,可是上面的代码没达到那个效果,把<%if rs("val")=an then%>改成<%if rs("val")=1 then%>,form1里的值等于1的就可以被选中,该怎么修改呢!