<div dir="ltr">If your function were to truly block, the user would not be able to interact with any elements (read: your modal dialog). Here's the pattern:
$("#dialog").dialog({
buttons: {
"Ok": function() { // do something with $(this).find('control').val() },
"Cancel": function() { // close dialog }
}
});
- Richard