多个ID中条件加Or连接即可。
刚才代码没写好,现在重新写一下
[CODE]<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>
<%
if request.form("action")="批量删除" then
delid=request.form("delid")
if delid<>"" and not isnull(delid) then
conn.execute "delete from UserMain where id in ("&delid&")"
end if
%>
<form action="" method="post">
<%
set rs=server.createobject("adodb.recordset")
rs.open "select * from UserMain order by id desc",conn,1,1
do while not rs.eof
%>
<input type="checkbox" name="delid" value="<%=rs("id")%>" />
<%
rs.movenext
loop
rs.close
set rs=nothing
%><br />
<input type="checkbox" name="chkall" onclick="CheckAll(this.form);" />
<input type="submit" name="action" value="批量删除" />
</form>[/CODE]
[此贴子已经被作者于2007-11-5 17:06:29编辑过]