How to set default button to "Cancel" when using window.confirm?

Discussion in 'Javascript' started by Jane, Feb 23, 2004.

  1. Jane

    Jane Guest

    How to set the default button to "Cancel" instead of "OK" when pop-up
    the message box using the codes below:

    if (window.confirm("Are you sure you want to delete?")) {
    //Proceed to delete
    }

    Please advise, many thanks!!!!

    Jane.
     
    Jane, Feb 23, 2004
    #1
    1. Advertising

  2. Jane

    kaeli Guest

    In article <>,
    enlightened us with...
    > How to set the default button to "Cancel" instead of "OK" when pop-up
    > the message box using the codes below:
    >
    > if (window.confirm("Are you sure you want to delete?")) {
    > //Proceed to delete
    > }
    >
    > Please advise, many thanks!!!!
    >
    > Jane.
    >


    I don't think you can.
    The best way (IMO) to prevent user mistakes is a confirmation page.

    --
    --
    ~kaeli~
    The secret of the universe is @*&^^^ NO CARRIER
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
     
    kaeli, Feb 23, 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. JerryK

    confirm does not cancel postback?

    JerryK, Mar 22, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    5,489
    JerryK
    Mar 22, 2005
  2. Replies:
    3
    Views:
    1,271
    Eliyahu Goldin
    Apr 4, 2006
  3. Tasha's Dad

    Need to cancel a javascript alert/confirm box

    Tasha's Dad, Nov 4, 2004, in forum: Javascript
    Replies:
    5
    Views:
    316
    kaeli
    Nov 9, 2004
  4. Indu
    Replies:
    9
    Views:
    359
  5. FAQ server
    Replies:
    4
    Views:
    504
    Evertjan.
    Mar 7, 2007
Loading...

Share This Page