check box
<input type= "checkbox" name= "checkbox" Value= "a" >
<input type= "checkbox" name= "checkbox" value= "B" >
<input type= "checkbox" name= "checkbox" Value= "C" >
<input type= "checkbox" name= "checkbox" value= "D" >
In this case, the Name property of the check box is the same, so that a control array is created, and when returned back to the background, the selected checkbox is connected in sequence with "," and if we select B and C, then use
Response.Write Request ("checkbox") returns the B,c
You can use split to isolate an array, for example
Bb=split (Request ("checkbox")
For each B in BB
Response.Write b
Next
This shows the value of the selected checkbox.
Case: multi-directional deletion!
Test passed
<% @LANGUAGE = "VBSCRIPT" codepage= "936"%>
<!--#include file= "conn.asp"-->
<%
Set Rs=server. CreateObject ("Adodb.recordset")
Sql= "SELECT * from class ORDER by date Desc"
Rs.Open sql,conn,1,1
If Rs.eof Then
Response. Write ("no Class")
Response.End
End If
%>
<title>untitled document. Lt;/title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<link href= ". /css/fe.css "rel=" stylesheet "type=" Text/css ">
<script >
function Yesno ()
{
Return confirm ("will delete all members and message information, are you sure you want to delete the class?");
}
</script>
<body leftmargin= "0" topmargin= "0" >
<table width= "border=" 0 "cellpadding=" 0 "cellspacing=" 0 ">
<tr>
<TD width= "height=" align= "center" >i d</td>
<TD height= align= "Center" > class name </td>
<TD width= "height=" align= "Center" > Registration date </td>
<TD height= align= "center" > Number </td>
<TD align= "center" > Delete? </td>
</tr>
<%
While not rs.eof
%>
<form name= "Form2" method= "post" action= "dec.asp" ><tr>
<TD width= "height=" align= "Center" >
<input type= "checkbox" Name= "id" value= "<%=rs (" ClassID ")%>" >
</td>
<TD width= "height=" align= "Center" ><%=rs ("classname")%></td>
<TD width= align= "center" ><%=rs ("date")%></td>
<TD width= "height=" align= "Center" ><%=rs ("num")%></td>
<TD width= "height=" align= "center" ></td>
</tr><%rs.movenext
Wend
Rs.close
Set rs=nothing
Conn.close
Set conn=nothing
%>
<tr>
<TD height= align= "center" > </td>
<TD height= align= "center" > </td>
<TD align= "center" > </td>
<TD height= align= "center" > </td>
<TD height= align= "center" >
<input type= "Submit" name= "submit" value= "Delete" ></form>
</td>
</tr>
</table>
</body>
Dec.asp
<% @LANGUAGE = "VBSCRIPT" codepage= "936"%>
<!--#include file= "conn.asp"-->
<title>untitled document. Lt;/title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<body>
<%
Sql= "DELETE from class WHERE ClassID in (" & Request.Form ("id") & ")"
Conn.execute (SQL)%>
</body>