xiliumy 2014-12-23 05:08 采纳率: 0%
浏览 1703

哪位大哥帮我看下,for循环执行不了,只能执行一条记录,跪谢。


cust_list.asp页面中的代码如下:

function del(){ var num=document.getElementById("ckcount"); if(num.innerHTML=="0") { alert('至少要选择一条记录') } else{ if(confirm('确定要删除该表资料吗?')) { var number=document.getElementById("hiddnum"); for(e=0;e<number.value;e++) {if (document.getElementById("custom"+e).checked==true) { document.write(document.getElementById("custom"+e).value); } else{} } } } }



<%
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=&#39;cust_list.asp&#39;"
end if

%>

删除

public.asp页面中的代码如下:

<%
For i = 0 To rs.pagesize -1
If rs.bof Or rs.EOF Then Exit For
%>


我现在想实现全选删除cust_list.asp页面中的记录,可是只能删除一条,求哪位大哥帮忙看下,我不是太懂的。谢谢了。

  • 写回答

4条回答 默认 最新

  • aifuqiang0412 2014-12-23 05:18
    关注

    1.number.value 先确定number.value的值是否是大于1的数字
    2.将number.value转换为number,
    3.document.getElementById("custom"+e) 是不是你需要的对象

    随便用个浏览器,F12.

    评论

报告相同问题?

悬赏问题

  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch