Confirm dialog box

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marc

    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
  • kaeli

    #2
    Re: Confirm dialog box

    In article <acad69df.04020 61039.328a1ef4@ posting.google. com>,
    meelzooi2000@ya hoo.com enlightened us with...[color=blue]
    > 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.
    >[/color]

    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="whateve r.asp" method="post" onSubmit="retur n
    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.



    Comment

    Working...