Skip to main content

Bug Tracker

Side navigation

#3266 closed bug (invalid)

Opened August 20, 2008 01:56AM UTC

Closed August 20, 2008 04:25PM UTC

Last modified March 14, 2012 09:26PM UTC

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.

Attachments (0)
Change History (3)

Changed August 20, 2008 01:57AM UTC by khmerler2004 comment:1

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

Changed August 20, 2008 04:25PM UTC by flesler comment:2

cc: → khmerler2004
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.

Changed August 20, 2008 05:40PM UTC by nathanhammon comment:3

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"); }
	}
});