Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 confirm before delete
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

chumbawumba
Junior Member

United Kingdom
304 Posts

Posted - 29 September 2003 :  06:42:38  Show Profile
I need some assistance creating a js prompt on my site.

i have a load of links on my site, which point to a delete page:

<a href="del.asp?section=ref&id=1">delete?</a>
<a href="del.asp?section=aaa&id=2">delete?</a>
<a href="del.asp?section=bbb&id=55">delete?</a>
<a href="del.asp?section=ccc&id=203">delete?</a>
etc..

I would like a javascript popup to appear when the link is clicked to prevent accidental deletion

ARE YOU SURE YOU WANT TO DELETE THIS?

YES/NO

if YES then go to the delete page, and if the user presses NO then stay on this page

i guess i need:
<a href="del.asp?section=zzz&id=203" onclick="doJSthingHERE">delete?</a>

can anyone provide the code for this?
thanks!

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 29 September 2003 :  08:01:10  Show Profile
Try the following, replacing the parts in green to suit your needs:
<a href="URI" onclick="return confirm('Message');">text/image</a>

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

Bullschmidt
New Member

USA
56 Posts

Posted - 30 September 2003 :  21:48:28  Show Profile  Visit Bullschmidt's Homepage
And by the waythe same concept could apply for a button too:

<input type="submit" name="btnDel" value="Delete" onclick="return confirm('Are you sure you want to delete this record?');">

J. Paul Schmidt, Freelance ASP Web Developer
www.Bullschmidt.com
Classic ASP Design Tips, ASP Web Database Sample (Freely Downloadable)
Go to Top of Page

chumbawumba
Junior Member

United Kingdom
304 Posts

Posted - 01 October 2003 :  08:53:33  Show Profile
thanks a lot, it now works perfectly.
(Bullschmidt: interesting tip on your website about renaming the .mdb to a .asp !)
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 01 October 2003 :  09:18:26  Show Profile
You're welcome, Chumbawumba.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

Bullschmidt
New Member

USA
56 Posts

Posted - 02 October 2003 :  08:59:53  Show Profile  Visit Bullschmidt's Homepage
<<
(Bullschmidt: interesting tip on your website about renaming the .mdb to a .asp !)
>>

Thanks - kind of strange but it really seems to work.

J. Paul Schmidt, Freelance ASP Web Developer
www.Bullschmidt.com
Classic ASP Design Tips, ASP Web Database Sample (Freely Downloadable)
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.36 seconds. Powered By: Snitz Forums 2000 Version 3.4.07