SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard
    Join Date
    Oct 2004
    Location
    Newport Beach
    Posts
    1,761
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Custom Confirm Options (not just 'OK' and 'Cancel')

    I have been using a javascript confirm function for when a person clicks a certain link.

    The confirm gives two options: OK or Cancel.

    Can I change these options? I want 'Delete' or 'Keep'

    Possible?

    Thanks
    Ryan
    Upcoming Movies - Movie News. Updated Daily.
    Movie Trailers - Awesome trailer site. Nuff said.

  2. #2
    SitePoint Member
    Join Date
    Dec 2005
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would be interested if there was a way as well. I haven't found it and instead created a pop-up box with the buttons named the way I wanted them to be named. Javascript then passed the value back to my main page depending on what button was clicked.

    It's a workaround but seemed to work quite well so far.

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2004
    Location
    Rancho Cordova
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yup, dimtrucks method is a good workaround. vbscript has the ability to customize the prompt, it is not the case for javascript.

    Basscyst

  4. #4
    SitePoint Wizard
    Join Date
    Oct 2004
    Location
    Newport Beach
    Posts
    1,761
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And how would I do this?

    I have the confirm, but my javascript is limited.

    Passing variables, sounds like I need a brief tutorial.

    Thanks
    Ryan
    Upcoming Movies - Movie News. Updated Daily.
    Movie Trailers - Awesome trailer site. Nuff said.

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,840
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    VBScript only runs on intranets where IE is the only browser. Other browsers don't understand vbscript at all. To get modal dialogs other than the ones you get from alert, confirm, and prompt you have to build them in your web page content yourself.

    See http://javascript.about.com/library/blmodald1.htm for an example of one way to do it.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •