| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1677 人关注过本帖
标题:全选删除问题
取消只看楼主 加入收藏
peiyanjian
Rank: 1
等 级:新手上路
帖 子:96
专家分:0
注 册:2008-2-29
收藏
 问题点数:0 回复次数:3 
全选删除问题
全选和删除的代码应该怎么写呀?/放到哪里呢??

<!--#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>&nbsp;
<a href="/students.ASP?page=<%=epage-1%>">前一页</a>&nbsp;
<a href="/students.ASP?page=<%=epage+1%>">后一页</a>&nbsp;
<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>
搜索更多相关主题的帖子: quot Microsoft DSNtemp Driver mdb 
2008-03-28 21:37
peiyanjian
Rank: 1
等 级:新手上路
帖 子:96
专家分:0
注 册:2008-2-29
收藏
得分:0 
要加到哪里呀??

上面怎么改动一下呢
2008-03-29 11:09
peiyanjian
Rank: 1
等 级:新手上路
帖 子:96
专家分:0
注 册:2008-2-29
收藏
得分:0 
谢谢,我好好研究一下吧
2008-03-30 08:34
peiyanjian
Rank: 1
等 级:新手上路
帖 子:96
专家分:0
注 册:2008-2-29
收藏
得分:0 
好像还是不行呀!!全选不了呀!
2008-03-31 21:02
快速回复:全选删除问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.040423 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved