<%@ CODEPAGE = "936" %>
<!--#include file="Connections.asp" -->
<!--#include file="conn.asp" -->
<title>删除结果</title>
<script language="JavaScript">
<!--
function a(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<script language="JavaScript">
function test(){
if (document.form2.page.value=="" || isNaN(document.form2.page.value)) {
alert("输入页数必须为数值型");
document.form2.page.focus();
return false;
}
return true;
}
</script>
<script>
function del() //用于判断记录有没有选中的函数
{
var flag=true;
var temp="";
var tmp;
if((document.form1.answer.length+"")=="undefined") {tmp=1}else{tmp=document.form1.answer.length}
if (tmp==1){
if (document.form1.answer.checked){
flag=false;
temp=document.form1.answer.value
}}else
{
for (i=0;i<document.form1.answer.length;i++) {
if (document.form1.answer[i].checked){
if (temp=="")
{
flag=false;
temp=document.form1.answer[i].value
}
else
{flag=false;
temp = temp +","+ document.form1.answer[i].value
}}}}
if (flag){ alert("对不起,你还没有选择!")}
else
{name=document.form1.name.value
if (confirm("确定要批量删除?")){ window.location="delt.asp?mobile=" + temp;}}
return !flag;
}
</script>
<script language=Javascript>
function checkall(all)//用于判断全选记录的函数
{
var a = document.getElementsByName("answer");
for (var i=0; i<a.length; i++) a[i].checked = all.checked;
}
</script>
<div align="center">
<center><form method="POST" id=form1 name=form1>
<table wMobileth=363 border="1" cellspacing="0" cellpadding="0" bordercolor="<%=bgcolor%>" width="181" height="98">
<TR >
<TD class=tdc1 wMobileth="94%" width="171"><center>
<table wMobileth="320" border="1" cellspacing="0" cellpadding="4" style="border-collapse: collapse" bordercolor="<%=bgcolor%>" width="100%">
<tr align="center">
<td height="22" class=tdc1 <%=hColor%>>号码<% If Session("guestbookfeiyue") <> "" Then %>删除<% end if%></td>
</tr>
</table></center></td>
</tr>
<tr>
<td width="171">
<p align="center">
<% mobile=request("mobile")
key=request("key")
keys=Split(key,chr(10))
for each onekey in keys
%>
<td></tr>
<tr>
<td width="171">
<p align="center">
<input type="checkbox" name="answer" value="<%=onekey%>" id="Checkbox1">
<a href="dele.asp?mobile=<%=onekey%>" target="_blank"><%=onekey%></a><br>
<%
set rstopic2 = server.createobject("adodb.recordset")
sql = "select * from cust where mobile like '%"&onekey&"%' order by name desc"
rstopic2.open sql,conn,1,1
if not(rstopic2.BOF or rstopic2.EOF) then
Mobile=rstopic2(0)
Memo=rstopic2(1)
GroupID=rstopic2(2)
Name=rstopic2(3)
line=line & Mobile&"|"&Memo&"|"&GroupID&"|"&Name&""
end if
set rstopic2=nothing
NEXT
%><td></tr><tr>
<td width="171"><p align="center">
<input type="checkbox" name="chkall" value="on" onclick="checkall(this)" ID="Checkbox2">选中所有
<input type="button" name="btnDelete" value="删除" style='font-family: 宋体; font-size: 9pt;' onclick="del()" ID="Button1">
</td></tr></td></tr>
</table></form></div>这些是result.asp的代码!
怎么写删除的delt.asp,就是上面我发的代码怎么修改为批量删除的啊。