tags:

views:

43

answers:

2

How can I make DialogBox (confirmation message and OK & Cancel buttons) wait for user action and return boolean result (true is OK was clicked, false otherwise)?

Thanks in advance.

+1  A: 

The simplest way to do this is to use Window.confirm, which "Displays a message in a modal dialog box, along with the standard 'OK' and 'Cancel' buttons."

aem
+2  A: 

Other way would be to split your code and put all that which has to be executed after ok/cancel click in a callback. Execute the callback in the ok/cancel handlers of the dialog box.

Ashwin Prabhu