|
| |
|
|
jonance
Posts: 298 From: Louisville KY USA Status: offline
|
confirm delete - 3/25/2001 20:16:00
Hi,I have a database that users can add, update, and delete items in. The delete option is a hyperlink going to the page with the sql code to delete the listing with paramaters passed. I need something that will say "Are you sure you want to delete?" before the deletion, giving them a chance to cancel or accept. I tried a couple of scripts but they were on the page with the code and even if you canceled it would send you back to the other page but the item was still deleted. Thanks in advance for your help. Thanks, John
|
|
|
|
Vince from Spain
Posts: 658 From: Madrid Spain Status: offline
|
RE: confirm delete - 3/26/2001 20:39:00
Hi John, this simple bit of javascript works for me every time . . .  In the head section . . . <script language="JavaScript"> <!-- function delrec(id) { cmsg = "¿Seguro que quiere borrar este archivo?\n" if (confirm(cmsg)) { window.location="anotherpage.asp?id=" + id; } } // --> </script> Then form your links like . . . <a href="javascript:delrec('<%=RS("productID")%>')">go to top</a> I've also illustrated how you could change a Querystring parameter (like anotherpage.asp?rectodelete=45 for instance). All the best Vince
------------------ Internet Business Solutions S.L.(Spain)
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|