views:

955

answers:

4

How to write a confirm dialog in javascript with custom choices?

Instead of just "Ok" and "Cancel", I would like to have for example "This" "That" and "Other".

A: 

You would have to write yourself new dialogs. You can't alter the existing ones, as far as I know.

Maybe this http://scottmoniz.com/programmingBlog/2009/07/custom-javascript-alert-and-confirm-dialog-boxes/ will help you.

x3ro
+2  A: 

In short, you can't.

You might want to consider looking into using something like a jQuery UI dialog instead.

Jordan Ryan Moore
A: 

You can't. Use some javascript UI (jQuery UI, YUI, Mootools) library and mimic a dialog you need.

NilColor
A: 

Hi. I am Scott Moniz owner of The Infinite Loop Blog. Here is the updated link that x3ro gave you (I recently moved servers):

Javascript Custom Alert and Confirm Dialogs

The Infinite Loop Blog