I am sifting through prompt()
and confirm()
replacements for JavaScript. I need to create a couple of confirm()s and alert()s that have three or more options. I would like to use the Lightbox class that I am using already. However, none of the replacements I have found can return the result of the operation directly like confirm() and prompt() can:
success = confirm("Success yes / no?");
if (success == true)
......
can a replacement be written so that it behaves in the same manner, i.e. that it opens a dialog, waits for user input and returns which buttons have been clicked? Or is this impossible to do (That's what I'm suspecting right now) and you have to work around it by attaching the actions to the "yes / no / whatever" buttons themselves?
Edit: I have decided to unaccept Josh's answer after all. It is totally helpful, but it doesn't answer the question - is there a way to have truly modal dialogs in Javascript? There doesn't seem to be.