Bug Tracker

Ticket #3266 (closed bug: invalid)

Opened 6 years ago

Last modified 3 years ago

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
Blocking: Blocked by:

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

comment:1 Changed 6 years ago by khmerler2004

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

comment:2 Changed 6 years ago by flesler

  • Cc khmerler2004 added
  • Status changed from new to closed
  • Resolution set to invalid

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 6 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.