日期:2014-05-17  浏览次数:20858 次

复选框即可全选,也可单选,怎办?
复选框即可全选,也可一个一个选取,怎办?下面代码只可一个一个选取,怎样改成我要的效果
代码:
<%
do   while   not   rs.eof
%>

                            <table   width= "800 "   border= "1 ">
                                <tr>  
                                    <td   width= "28 ">  
                                          <input   type= "checkbox "   name= "checkbox "   value= " <%=rs( "id ")%> "   >
                                    </td>  
                                    <td   width= "84 ">  
                                        <div   align= "center "> <font   size= "1 "> <%=rs( "testnumber ")%> </font> </div>
                                    </td>
                          <%
rs.movenext
loop
rs.close
%>
  <input   type= "hidden "   name= "grade "   value= " <%=request.querystring( "grade ")%> ">
                            <input   type= "hidden "   name= "class "   value= " <%=request.querystring( "class ")%> ">
                            <div   align= "center "> <br>
                                <input   type= "submit "   name= "Submit "   value= "     删除所选中的数据     "   style= "border:   1pt   solid   #EEEEEE ">
                                <input   type= "reset "   name= "Submit2 "   value= "     重新选择     "   style= "border:   1pt   solid   #EEEEEE ">


------解决方案--------------------
如果有3个复选框 他们的值分别是 a1 a2 a3 注意name必须相同
选中 a1 时 request( "name ") 得到的值是 a1
同时选中 a1 a3 时 request( "name ") 得到的值是 a1,a3

后台你可以用 split 方法把a1,a3变成数组进行操作

------解决方案--------------------
<html>


<head>

<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">

<title> 复选框全选、