asp复选框传值问题
<%Setrs=Server.CreateObject("Adodb.RecordSet")rs.Open"Select*fromBigClass_NeworderbyB...
<%
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open "Select * from BigClass_New order by BigClassID desc",conn,1,3
%>
<td>
<%do while not rs.eof%>
<input type="checkbox" name="BigClassID" value="<%=rs("BigClassID")%>">
<%=rs("BigClassName")%>
<%rs.movenext
loop
rs.close
set rs=nothing
%></td>
save.asp
<%Purview=replace(trim(Request("BigClassID")),"'","")%>
<%set rs=server.createobject("adodb.recordset")
sql="select * from admin"
rs.open sql,conn,1,3
'添加一个管理员帐号到数据库
rs.addnew
rs("UserName")=UserName
rs("PassWord")=password
rs("Purview")=Purview
rs.update
rs.close
set rs=nothing%>
如果只选一个,数据库中有值,如果多选,数据库中就没值,在线等 展开
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open "Select * from BigClass_New order by BigClassID desc",conn,1,3
%>
<td>
<%do while not rs.eof%>
<input type="checkbox" name="BigClassID" value="<%=rs("BigClassID")%>">
<%=rs("BigClassName")%>
<%rs.movenext
loop
rs.close
set rs=nothing
%></td>
save.asp
<%Purview=replace(trim(Request("BigClassID")),"'","")%>
<%set rs=server.createobject("adodb.recordset")
sql="select * from admin"
rs.open sql,conn,1,3
'添加一个管理员帐号到数据库
rs.addnew
rs("UserName")=UserName
rs("PassWord")=password
rs("Purview")=Purview
rs.update
rs.close
set rs=nothing%>
如果只选一个,数据库中有值,如果多选,数据库中就没值,在线等 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询