{for (var i=0;i<form.elements.length;i++)
{var e = form.elements[i];
if (e.name != ''chkall'')
e.checked = form.chkall.checked;
}
}
</script>
</head>
<body>
<form method="post" action="del.asp" name="form1">
<table>
<tr>
<td ><input type="checkbox" value="111" name="TradeName">电子邮件1</td>
</tr>
<tr>
<td ><input type="checkbox" value="111" name="TradeName">电子邮件2</td>
</tr>
<tr>
<td ><input type="checkbox" value="111" name="TradeName">电子邮件3</td>
</tr>
<tr>
<td ><input type="checkbox" value="111" name="TradeName">电子邮件4</td>
</tr>
<tr>
<td ><input type="checkbox" value="111" name="TradeName">电子邮件5</td>
</tr>
<tr>
<td ><input type="checkbox" value="111" name="TradeName">电子邮件6</td>
</tr>
<tr>
<td bgcolor="#F1FBFC" height="25" colspan="2">
<p align="left"><input type="checkbox" name="chkall" value="on" onclick="CheckAll(this.form)"><font color="#FF9900">选中所有显示的消息</font></p>
</td>
<center>
</tr>
</table>
</form>
2、删除文件del.asp
<%
''这行写连接数据库的代码
dim ID,strID
strID=""
For Each strID In Request.Form("TradeName")
ID=Cint(strID)
if strID<>"" then
DelRs = Server.CreateObject("ADODB.Recordset")
Conn.Execute "Delete From Tbname where ID="&Cstr(ID)
strID=""
end if
Next
Conn.Close
Set Conn = Nothing
Response.Redirect "成功删除!"
%>