Sifting through replacements prompt() and confirm() for JavaScript. I need to create a pair of acknowledgment () s and alert () s that have three or more parameters. I would like to use the Lightbox class that I am using already. However, none of the substitutions found can return the result of the operation directly, like confirm () and prompt ():
success = confirm("Success yes / no?"); if (success == true) ......
can a replacement be written so that it behaves the same way, that is, it opens a dialog box, waits for user input, and returns which buttons were pressed? Or is it impossible to do (this is what I suspect now), and you need to get around this by attaching the actions to the yes / no / independent buttons?
Edit: I decided to refuse Josh's answer in the end. This is absolutely useful, but it does not answer the question - is there a way to have really modal dialogs in Javascript? It seems not.
source share