Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: window.confirm

  1. #1
    New Coder
    Join Date
    Oct 2011
    Posts
    92
    Thanks
    38
    Thanked 0 Times in 0 Posts

    window.confirm

    please assist, I have the following code and wish to change the default OK and Cancel buttons to Yes and No buttons.
    How is this possible, I am sure there was a way with additional arguments within the brackets but cant seem to find it anywhere.

    Code:
    <script type='text/javascript'>	
        if (window.confirm('Username or Password INCORRECT! Do you want to Register?')) 
    		window.location.href='register.php'; 
    	else
    		window.location.href='index.php';
        </script>

  • #2
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    Can't be done. Those buttons come from the OS, not the browser. You can't change them.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,586
    Thanks
    78
    Thanked 4,385 Times in 4,350 Posts
    But you could, of course, instead create a POPON <div> that has any HTML content you want.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #4
    New Coder
    Join Date
    Oct 2011
    Posts
    92
    Thanks
    38
    Thanked 0 Times in 0 Posts
    Ok I have noticed that on Google as well.
    Now maybe something else then.
    I have an extra long message to display but want them on seperate lines like below is that possible? I have tried \n and it does not work.


    Username or Password INCORRECT!
    Press OK to Register a new user or CANCEL to try again.

  • #5
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    \n is only for JavaScript. If you're using HTML, you need <br />.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".


  •  

    Posting Permissions

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