asp 请问我这段代码写的对吗?<%if rs("id")=ty then response.Write "selected"end if%> 能解释下吗?
<%sql="select*fromjigouwheretype=2"'response.Writesqlrs.opensql,conn,1,1ty=Request("t...
<%
sql="select * from jigou where type=2"
'response.Write sql
rs.open sql,conn,1,1
ty=Request("type")
response.Write ty
%>
<select id="txt4" name="txt4" onchange="oation()" >
<%
Do While Not rs.EOF
%>
<option <%if rs("id")=ty then response.Write "selected"end if%> value="<%=rs("id")%>" ><%=rs("jgmc")%></option>
<%
Rs.movenext
Loop
Rs.Close
%>
在option我取不到变量ty的值,在上面都可以接收到,并且可以输出来. 展开
sql="select * from jigou where type=2"
'response.Write sql
rs.open sql,conn,1,1
ty=Request("type")
response.Write ty
%>
<select id="txt4" name="txt4" onchange="oation()" >
<%
Do While Not rs.EOF
%>
<option <%if rs("id")=ty then response.Write "selected"end if%> value="<%=rs("id")%>" ><%=rs("jgmc")%></option>
<%
Rs.movenext
Loop
Rs.Close
%>
在option我取不到变量ty的值,在上面都可以接收到,并且可以输出来. 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询