By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,607 Members | 1,970 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,607 IT Pros & Developers. It's quick & easy.

Confirm dialog box

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.