如何实现选定多条新闻的删除功能
单条新闻的删除已经实现,但一次删除多项实现不了
<script language="javascript">
function CheckAll(form){
for (var i=0;i<form.elements.length;i++){
var e = form.elements[i];
if (e.name != 'chkall') e.checked = form.chkall.checked;
}
}
</script>
<%
action=request("action")
if action="批量删除" then
delnum=replace(request("num")," ","")
if delnum="" or isnull(delnum) then
Response.write "<center><br><br>操作失败,没有选择合适参数!<meta http-equiv=refresh content=""2;URL=admin_client.asp""></center>"
else
conn.execute("delete from UserMain where UserNum in ("&delnum&")")
if err.number<>0 then '错误处理
response.write "数据库操作失败:" & err.description
err.clear
else
conn.close
set conn=nothing
call showinfo("admin_client.asp?page="&request("page")&"","用户删除")
end if
end if
else
set rs=server.createobject("adodb.recordset")
rs.open "select from UserMain order by id desc",conn,1,1
set id=rs("id")
set abc=rs("abc")
set bac=rs("bac")
set cba=rs("cba")
set cab=rs("cab")
%>
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#D4D0C8">
<form action="?page=<%=request("page")-1%>" method="post">
<%do while not rs.eof%>
<tr bgcolor="#f9f9f9" align="center">
<td><%=abc%></td>
<td><%=bac%></td>
<td><%=cba%></td>
<td><%=cab%></td>
<td style="font-size:8pt;"><input type="checkbox" name="num" value="<%=id%>"></td>
</tr>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
<tr bgcolor="#e7e7e7">
<td colspan="6" align="right"><input type="submit" name="action" value="批量删除" onclick="return confirm('该操作不可恢复!\n\n确实删除选定的客户?')" class="input"></td>
<td width="7%" align="center"><input type="checkbox" name="chkall" onclick="CheckAll(this.form)"></td>
</tr>
</form>
</table>