asp多选删除不好使,全选只能删除一条了,求大神给看看 50
cust_list.asp页面中的代码如下:functionedit(){str=""varnum=document.getElementById("ckcount");...
cust_list.asp页面中的代码如下:
function edit()
{
str=""
var num=document.getElementById("ckcount");
if(num.innerHTML=="0")
{
alert('至少要选择一条记录')
}
else{
if(confirm('确定要处理吗?'))
{
page=1
var number=document.getElementById("hiddnum");
for(i=0;i<number.value;i++)
{
if (document.getElementById("custom"+i).checked==true)
{
custid=document.getElementById("custom"+i).value
str+=custid+","
}
else{}
}
openwin('cust_tomer.asp?action=edit&id='+str,400,300);
}
}
}
<%
set rs=server.createobject("adodb.recordset")
if request("action")="del" then
sql="select * from t_custom where id="&request("id")
rs.open sql,conn,1,1
company=rs("company")
sql="delete from t_contact where company='"&company&"'"
conn.execute sql
sql="delete from t_custom where id="&request("id")
conn.execute sql
response.write "location.href='cust_list.asp'"
end if
%>
public.asp页面中的代码如下:
<%
For i = 0 To rs.pagesize -1
If rs.bof Or rs.EOF Then Exit For
%>
我现在想实现全选删除cust_list.asp页面中的记录,可是只能删除一条,求哪位大哥帮忙看下,我不是太懂的。谢谢了。 展开
function edit()
{
str=""
var num=document.getElementById("ckcount");
if(num.innerHTML=="0")
{
alert('至少要选择一条记录')
}
else{
if(confirm('确定要处理吗?'))
{
page=1
var number=document.getElementById("hiddnum");
for(i=0;i<number.value;i++)
{
if (document.getElementById("custom"+i).checked==true)
{
custid=document.getElementById("custom"+i).value
str+=custid+","
}
else{}
}
openwin('cust_tomer.asp?action=edit&id='+str,400,300);
}
}
}
<%
set rs=server.createobject("adodb.recordset")
if request("action")="del" then
sql="select * from t_custom where id="&request("id")
rs.open sql,conn,1,1
company=rs("company")
sql="delete from t_contact where company='"&company&"'"
conn.execute sql
sql="delete from t_custom where id="&request("id")
conn.execute sql
response.write "location.href='cust_list.asp'"
end if
%>
public.asp页面中的代码如下:
<%
For i = 0 To rs.pagesize -1
If rs.bof Or rs.EOF Then Exit For
%>
我现在想实现全选删除cust_list.asp页面中的记录,可是只能删除一条,求哪位大哥帮忙看下,我不是太懂的。谢谢了。 展开
2个回答
展开全部
<%
set rs=server.createobject("adodb.recordset")
if request("action")="del" then
sql="select * from t_custom where id="&request("id")
rs.open sql,conn,1,1
company=rs("company")
sql="delete from t_contact "删除t_contact表全部数据
conn.execute sql
sql="delete from t_custom where id="&request("id")
conn.execute sql
response.write "location.href='cust_list.asp'"
end if
%>
set rs=server.createobject("adodb.recordset")
if request("action")="del" then
sql="select * from t_custom where id="&request("id")
rs.open sql,conn,1,1
company=rs("company")
sql="delete from t_contact "删除t_contact表全部数据
conn.execute sql
sql="delete from t_custom where id="&request("id")
conn.execute sql
response.write "location.href='cust_list.asp'"
end if
%>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询