/ Published in: ASP
Expand |
Embed | Plain Text
<% if action = "del" then dim sId: sId = request.form("Id") dim arrId,iRow,iId,iCount arrId = split(sId,",") iCount = 0 for iRow = 0 to ubound(arrId ) iId = arrId(iRow) if len(iId) > 0 then oConn.execute("delete from table where id = " & iId) iCount = iCount + 1 end if next response.write "<div align=""center"" style=""color:blue;""><span style=""font-weight:bold;"">"&iCount&"</span> Id(s) deleted successfully</div>" end if sql="select * from table order by id" %> <form action=".asp" method="post" name="formName"> <input type="checkbox" name="Id" value="<%=%>"> <input type="button" onClick="if (confirm('Are you sure you want to delete?')) {document.formName.submit()}" value="Delete" /> <input type="hidden" name="action" value="del" /> </form>
You need to login to post a comment.
