全选删除问题
全选和删除的代码应该怎么写呀?/放到哪里呢??<!--#include virtual="/admin_qx.asp" -->
<%
set conn=server.createobject("adodb.connection")
DSNtemp = "Driver={Microsoft Access Driver (*.mdb)};"
DSNtemp = DSNtemp & "DBQ=" & server.mappath("date/student.mdb")
conn.open DSNtemp
stext = "select id,xuehao,xingming,zhiwu,
banji,chushengnianyue,minzu,zhengzhimianmao,dangtuanshijian,jiguan,ruwushijian,wenhuachengd
u,lianxidianhua,ruwudiqu,jiatingzhuzhi,youzhengbianma from stu order by banji"
set rs = conn.execute(stext)
if rs.eof then
response.write "database error"
response.end
end if
%>
<html>
<head>
<%
'set conn=server.createobject("adodb.connection")
'conn.open("DRIVER=Driver do Microsoft ACCESS (*.mdb);dbq="&server.mappath("student.mdb"))
set rs=server.createobject("adodb.recordset")
sql="select * from stu"
rs.open sql,conn,3
rs.pagesize=20
if request("page")<>"" then
epage=cint(request("page"))
if epage<1 then epage=1
if epage>rs.pagecount then epage=rs.pagecount
else
epage=1
end if
rs.absolutepage=epage
%>
<title>十五队学员</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
a:link { color: #000000; text-decoration: none}
a:visited { color: #000000; text-decoration: none}
-->
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<h2 align="center">欢迎来到sfsdfds理系统</h2>
<h4 align="center">可以点击某一行姓名来察看详细信息</h4>
<p><font color="#0066CC">相关操作: <a href="/xy_add.asp">添加学员</a> | <a
href="/students.asp">显示信息</a>
| <a href="/index.ASP">退出登陆</a></font></p>
<p>
<form name="form1" method="post" action="/ss.asp">
<td> 姓名
<input name="xingming" type="text" maxlength="10" size="15">
班级
<input name="banji" type="text" maxlength="10" size="15">
<input name="submit" type="submit" value="显示学生">
</td>
</form>
</p>
<hr size=3 noshadow width=150% align=left></hr>
<div align="center">
<table width="1600" border="1" cellpadding="0" cellspacing="0" bgcolor="#C7E8F8">
<tr>
<td height="22"><div align="center">
<input name="checkbox" type=checkbox id="checkbox" onClick="this.value=check
(this.form.seltyid)" value="全选">
</div></td>
<td>
<div align="center"><font color="#FF0000">姓名</font></div>
</td>
<td>
<div align="center">学号</div>
</td>
<td>
<div align="center">职务</div>
</td>
<td>
<div align="center">班级</div>
</td>
<td>
<div align="center">出生年月</div>
</td>
<td>
<div align="center">民族</div>
</td>
<td>
<div align="center">政治面貌</div>
</td>
<td>
<div align="center">党团时间</div>
</td>
<td>
<div align="center">籍贯</div>
</td>
<td>
<div align="center">入学时间</div>
</td>
<td>
<div align="center">文化程度</div>
</td>
<td>
<div align="center">联系电话</div>
</td>
<td>
<div align="center">入学地区</div>
</td>
<td>
<div align="center">家庭地址</div>
</td>
<td>
<div align="center">邮政编码</div>
</td>
</tr>
<%
Do while not rs.eof
%>
<TR>
<td height="22"><div align="center">
<input name="seltyid" type="checkbox" id="seltyid" value="<%=rs("id")%>">
</div></td>
<TD><div align="center"><a href='/stu_xx.asp?id=<%=rs("id") %>'><%=rs("xingming")
%></a></div></TD>
<%
%>
<td><div align="center">0<%=rs("xuehao") %></div></td><td><div align="center"><%
=rs("zhiwu") %></div></td><td><div align="center"><%=rs("banji") %></div></td><td><div
align="center"><%=rs("chushengnianyue") %></div></td><td><div align="center"><%=rs("minzu")
%></div></td><td><div align="center"><%=rs("zhengzhimianmao") %></div></td><td><div
align="center"><%=rs("dangtuanshijian") %></div></td><td><div align="center"><%=rs
("jiguan") %></div></td><td><div align="center"><%=rs("ruwushijian") %></div></td><td><div
align="center"><%=rs("wenhuachengdu") %></div></td><td><div align="center"><%=rs
("lianxidianhua") %></div></td><td><div align="center"><%=rs("ruwudiqu") %
></div></td><td><div align="center"><%=rs("jiatingzhuzhi") %></div></td><td><div
align="center"><%=rs("youzhengbianma") %></div></td></tr>
<%
rs.movenext
Loop
%>
</table>
<p align="center">
</p>
<p align="center">现在是第<%=epage%>页一共有<%=rs.pagecount%>页
<a href="/students.ASP">首页</a>
<a href="/students.ASP?page=<%=epage-1%>">前一页</a>
<a href="/students.ASP?page=<%=epage+1%>">后一页</a>
<a href="/students.ASP?page=<%=rs.pagecount%>">末页</a></p>
<form name="form2" method="post" action="">
<span class="STYLE13"> 全选/不选</span>
<input name="checkbox2" type=checkbox onClick="this.value=check(this.form.seltyid)"
value="全选">
<input type="submit" name="Submit4" value="删除" onClick="subdeletetozhan()"
style="width:85;background-color: #FFCC66; color: #000000; border: 1 solid #00CC00">
<input name="deleteorupdate" type="hidden" id="deleteorupdate">
<input name="deleteall" type="hidden" id="deleteall">
<input name="caozuo" type="hidden" id="caozuo">
</form>
</div>
<%
rs.close
conn.close
%>
</body>
</html>
<script language="javascript">
//
function subdeleteforever()
{
if (window.confirm('真的要永久删除所选学员吗?该操作不可恢复!继续吗?'))
{
form2.action="xy_delete_all.asp";
form2.deleteall.value="deletforever";
form2.submit();//提交该表单;
}
}
function subdeletetozhan()
{
form2.action="admin_xy_caozuo.asp";
form2.caozuo.value="intozhan";
form2.submit();
}
</script>
<SCRIPT LANGUAGE="JavaScript">
<!--
var checkflag = "false";
function check(field) {
if (checkflag == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
checkflag = "true";
return "false"; }
else {
for (i = 0; i < field.length; i++) {
field[i].checked = false; }
checkflag = "false";
return "true"; }
}
-->
</script>