Bug Tracker

Opened 15 years ago

Closed 15 years ago

Last modified 11 years ago

#3266 closed bug (invalid)

dialog popup box does not work like javascript confirm

Reported by: khmerler2004 Owned by:
Priority: major Milestone: 1.3
Component: core Version: 1.2.6
Keywords: Cc: khmerler2004
Blocked by: Blocking:

Description

Hello

When I download the dialog pop up, it does not work like javascript confirm.

For example, var str=1; var str=confirm('do you want to delete'); alert(str);

Base on the code above, the str variable is waiting for a confirm from your interaction. If user do not click on ok or cancel, the alert(str) won't get execute.

In jquery, it execute alert(str) at the same time as pop up.

Like this

var str = 1; $("#example").dialog({title:'This my pop box',height:400,width:400, modal:false, buttons:{"Ok": function() { str='yes'; }, "Cancel": function() { $(this).dialog("close"); } } });

alert(str);

When the first time you call the page, the alert(str)is 1 when you click on yes.

Change History (3)

comment:1 Changed 15 years ago by khmerler2004

I am looking for a dialog pop up that would work the same as javascript confirm function.

comment:2 Changed 15 years ago by flesler

Cc: khmerler2004 added
Resolution: invalid
Status: newclosed

It's impossible to make modal dialogs like confirm. Javascript execution cannot be stopped. If you have anything else to add, please repost to the UI Bug Tracker.

comment:3 Changed 15 years ago by nathanhammon

Also, something like this may get you the functionality you want (untested):

var str = 1;
$("#example").dialog({
	title:'This my pop box',
	height:400,
	width:400,
	modal:true,
	buttons: {
		"Ok": function() { str='yes'; alert(str); },
		"Cancel": function() { $(this).dialog("close"); }
	}
}); 
Note: See TracTickets for help on using tickets.