469,914 Members | 2,480 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,914 developers. It's quick & easy.

Confirm dialog box

Hello,

I have a form that lets the user click a submit button 'Delete'. It
deletes a record in a mySql databsae. I'd rarther have a JavaScript
alert asking the user 'Are you sure you want to do this?' before
submitting the form and deleting the record.

Like so:
user clicks 'Delete' button;
javascript alert appears 'are you sure?' [OK][Cancel];
[OK]: form gets submitted, record gets deleted;
[Cancel]: form gets not submitted, nothing happens.

Can anyone point me in the right direction?

Thanks,

Marc
Jul 20 '05 #1
1 1261
In article <ac**************************@posting.google.com >,
me**********@yahoo.com enlightened us with...
Hello,

I have a form that lets the user click a submit button 'Delete'. It
deletes a record in a mySql databsae. I'd rarther have a JavaScript
alert asking the user 'Are you sure you want to do this?' before
submitting the form and deleting the record.


I myself use a confirmation page. My pet users like to ignore alerts and
just click okay without reading them.
But, if you wish...

<form name="f1" action="whatever.asp" method="post" onSubmit="return
confirm('Are you sure you want to delete this? Don't be a moron and
click okay and then whine at me later that you deleted it by
accident.');">
--
--
~kaeli~
He often broke into song because he couldn't find the key.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Doug O'Leary | last post: by
2 posts views Thread by JerryK | last post: by
3 posts views Thread by ad | last post: by
8 posts views Thread by rn5a | last post: by
13 posts views Thread by MikeC | last post: by
1 post views Thread by =?Utf-8?B?UmFq?= | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.