CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript programming (http://www.codingforums.com/forumdisplay.php?f=2)
-   -   window.confirm (http://www.codingforums.com/showthread.php?t=276190)

hans_cellc 10-11-2012 08:54 PM

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>


WolfShade 10-11-2012 08:56 PM

Can't be done. Those buttons come from the OS, not the browser. You can't change them.

Old Pedant 10-11-2012 09:04 PM

But you could, of course, instead create a POPON <div> that has any HTML content you want.

hans_cellc 10-11-2012 09:12 PM

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.

WolfShade 10-11-2012 09:16 PM

\n is only for JavaScript. If you're using HTML, you need <br />.


All times are GMT +1. The time now is 02:45 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.