ASP网页上多项选中一起删除的问题(急!!)

birdwings 2006-06-26 06:10:36
<%do while not rs.eof%>
<tr class="tdbg">
<td width="47" height="22" align="center" bgcolor="#C0C0C0"> <input name='ArticleID' type='checkbox' onclick="unselectall()" id="ArticleID" value='<%=cstr(rs("articleID"))%>'>
</td>
<td width="28" align="center" bgcolor="#E3E3E3"><%=rs("articleid")%></td>
<td width="82" align="center" bgcolor="#E3E3E3"><%=rs("Product_Id")%></td>
<td bgcolor="#E3E3E3"> <a href="../ArticleShow.asp?ArticleID=<%=rs("articleid")%>" target="_blank"><%=rs("title")%></a></td>
<td width="68" align="center" bgcolor="#E3E3E3"><%= FormatDateTime(rs("UpdateTime"),2) %></td>
<td width="68" align="center" bgcolor="#E3E3E3">
<%if rs("Passed")=true then%>
已审核
<%else%>
<font color="#FF0000">未审核</font>
<%end if%>
</td>
<td width="80" align="center" bgcolor="#E3E3E3">
<a href="Bs_Article_edit.asp?ArticleID=<%=rs("articleid")%>">修改</a>
<a href="Bs_Article_Del.asp?ArticleID=<%=rs("ArticleID")%>&Action=Del">删除</a>
</td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<table width="600" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="250" height="30"><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
选中本页显示的所有产品</td>
<td><input name="submit" type='submit' value='删除选定的产品' <%if session("purview")>=3 and session("purview")<=4 and PurviewChecked=False then response.write "disabled"%>>
<input name="Action" type="hidden" id="Action" value="Del"></td>
</tr>
</table>
上面是从数据库里一项项读出来,然后再显示,可以单项修改或删除,我把ID传过去了。。
但是现在要多项一起删,怎么传参数过去?因为无论带?或用session一次都只能传一个ID。。
我自认为是用个循环把选中的循环传过去一个个删,怎么实现,有高人帮下吧。。小D太菜了。。
...全文
180 8 打赏 收藏 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
李睿_Lee 2006-06-27
  • 打赏
  • 举报
回复
in后面要注意加()
yongfa365 2006-06-27
  • 打赏
  • 举报
回复
asp007() ( ) 信誉:100
唉!无聊之际,借花献佛,错错错
你不觉得这个很有必要吗?如果真是菜的话这个对他来说很有作用,可视化效果,何谈无聊之际

我可不汗

也许有这种人吧
birdwings 2006-06-27
  • 打赏
  • 举报
回复
谢谢各位的帮忙。特别感谢一楼和二楼的,主要是我自已没留意submit是把整个表单传过去了,这样就实现了传多个值,效果已实现,结贴。。。
asp007 2006-06-26
  • 打赏
  • 举报
回复
<%filepath=request.servervariables("script_name")%>
<form action="<%=filepath%>" method="post">
<input type="checkbox" name="checkbox" value="1" id=check>
<input type="checkbox" name="checkbox" value="2" id=check>
<input type="checkbox" name="checkbox" value="3" id=check>
<input type="checkbox" name="checkbox" value="4" id=check>
<input type="checkbox" name="checkbox" value="5" id=check>
<input type="submit" value="提交">
</form>
<%
id=request("checkbox")
response.write id
%>
无聊之际,借花献佛,向楼主表敬意!楼主的问题我知道,可我写不出楼主那长长的代码!已经html结合asp写代码了,还写到验证啊。审核啊。楼主强啊!向楼主学习!自己汗一下
zhangjingcheng 2006-06-26
  • 打赏
  • 举报
回复
同意楼上的!
yongfa365 2006-06-26
  • 打赏
  • 举报
回复
<input type="checkbox" name="checkbox" value="1" id=check>
<input type="checkbox" name="checkbox" value="2" id=check>
<input type="checkbox" name="checkbox" value="3" id=check>
<input type="checkbox" name="checkbox" value="4" id=check>
<input type="checkbox" name="checkbox" value="5" id=check>

id=request("checkbox")
response.write id
试一下
yongfa365 2006-06-26
  • 打赏
  • 举报
回复
菜极了,

就楼上说的,如果你是从数据库里取出来的,保证,check的name一样的话,让value=<%=rs("id")%>你选中了多个,则,id=1,2,3,4,5,6......而不是只传一下,
所以,用楼上的
delete from [yourTable] where [id] in request("id")
zl_c 2006-06-26
  • 打赏
  • 举报
回复
用in

例:delete from [yourTable] where [id] in (1,2,3,4,5)

28,402

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧