Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Confirm dialog box

Reply
Thread Tools

Confirm dialog box

 
 
Marc
Guest
Posts: n/a
 
      02-06-2004
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
 
Reply With Quote
 
 
 
 
kaeli
Guest
Posts: n/a
 
      02-06-2004
In article < >,
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Script Manager - Confirm dialog box =?Utf-8?B?UmFq?= ASP .Net 1 05-18-2007 06:37 PM
Building a dialog box in that looks like Confirmation box (ASP.NET). Please help !!! bienwell ASP .Net 5 08-13-2006 03:54 AM
Problem showing confirm dialog on button webcontrol's onclick even =?Utf-8?B?VGFydW4gVXBhZGh5YXlh?= ASP .Net 3 06-02-2005 04:19 PM
JS Confirm dialog from datagrid template column Patrick Delifer ASP .Net 2 04-28-2004 06:38 PM
Finally found how to display confirm dialog box Tony Baker ASP .Net 0 12-17-2003 11:59 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57