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 o
Most JavaScript frameworks that have UI components have some kind of dialog that will provide callbacks. Check out jQuery UI, for example: http://jqueryui.com/demos/dialog/
I've used it in multiple projects to do exactly what you're describing.
Edit: I was hoping to suggest a workaround. Unfortunately JavaScript does not include methods to override and add additional buttons or options to the default browser-based Alert(), Confirm(), or Prompt() dialogs.
Both IE and Firefox 3 have a showModalDialog method which would allow you to display an entire web page modally. However for a truely cross-browser solution you can't use that.
Many of the popular frameworks provide a mechanism to do it by displaying a HTML element and disabling access to the rest of the web page whilst the element is displayed.