It seems like adding some extra buttons might be a helpful function, because alerts are (have always been) so limited. Adding a "cancel" or "skip" button, a "next", etc, would help. Then again, all you would have to do for any of that is add an optional (because we might only want the ok box) button that cancels it and then just make that title editable as well-- and maybe make the ok editable too, so you can say "login" for the username, etc.
so the new way to call it is:
Code:
msgbox.show("Message","title","OK"); //button says ok
msgbox.show("Message","title",0); //the main button is disabled-- this is a problem because the page is locked... maybe intentional, like "Please refresh"
msgbox.show("Message","title","Next","Cancel"); //Now two buttons are used, one to go on (the normal one), and a new one, that closes the window "cancel"
msgbox.show("Message","title",0,"Cancel"); //Now just cancel appears
//msgbox.show("Message","title","OK",0); //Note that this is the same as the first example
Now I realize that I'm not sure what your code DOES, in that you say "you must enter your username first", but the button on that seems like it should be a submit, next, etc., sort of button-- like "OK, redirecting now" and the button reads "redirect", and then doesn't just close the window but also submits an action. Perhaps there should be some more complex functionality there, like a Javascript argument fed into the command itself like msgbox.show(....,"window.close"), etc.
Bookmarks