Confirm dialog box

Discussion in 'Javascript' started by Marc, Feb 6, 2004.

  1. Marc

    Marc Guest

    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
    Marc, Feb 6, 2004
    #1
    1. Advertising

  2. Marc

    kaeli Guest

    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
    kaeli, Feb 6, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tony Baker
    Replies:
    0
    Views:
    6,678
    Tony Baker
    Dec 17, 2003
  2. Patrick Delifer

    JS Confirm dialog from datagrid template column

    Patrick Delifer, Apr 27, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    679
    Patrick Delifer
    Apr 28, 2004
  3. =?Utf-8?B?VGFydW4gVXBhZGh5YXlh?=

    Problem showing confirm dialog on button webcontrol's onclick even

    =?Utf-8?B?VGFydW4gVXBhZGh5YXlh?=, Jun 1, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    3,525
    Peter Blum
    Jun 2, 2005
  4. bienwell
    Replies:
    5
    Views:
    5,175
    bienwell
    Aug 13, 2006
  5. =?Utf-8?B?UmFq?=

    Script Manager - Confirm dialog box

    =?Utf-8?B?UmFq?=, May 18, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    2,835
    Thomas Hansen
    May 18, 2007
Loading...

Share This Page