#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
comment:2 Changed 15 years ago by
Cc: | khmerler2004 added |
---|---|
Resolution: | → invalid |
Status: | new → closed |
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
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"); } } });
I am looking for a dialog pop up that would work the same as javascript confirm function.