[jQuery] Using $.blockUI() to make modal dialog

[jQuery] Using $.blockUI() to make modal dialog

Hi all,
I have been using $.blockUI with my ajax and image load events very
successfully. Thanks this is a great tool.
I need a modal dialog that ask if the user wants to save data or
continue without saving. I created a div with two buttons the and click
events on them to save or continue. And this works if I do something like:
$(function() {
$.blockUI($('#dialog')[0]);
alert("Hello!");
});
The dialog opens, the UI is blocked, and clicking on the buttons works
as expected, and the alert is shown after the dialog is dismissed.
The problem is that when I move this code into my application blockUI is
not blocking.
function save_form_data(ask) {
console.debug("save_form_data: ask="+ask+", form_dirty="+form_dirty);
if (!form_dirty) return;
// ask the user if they want to save it
if (ask) {
// ****** this sequence does not block **************
console.debug("action_save: calling blockUI");
$.blockUI($('#dirtyFormMessage')[0]);
console.debug("action_save: returned from blockUI");
}
else
action_save();
}
I'm running this mornings svn, FF 2.0.1 and it probably only works in FF.
Anyone have some thoughts on this?
You can test it here, sorry, it is not nearly as nice as the code I see
others generating:
http://imaptools.com/sm/
1) click the "GO"
2) click on the map image will enter data in IX, IY
3) click "NEXT"
This should bring up a dialog with a "SAVE_IT" and "CONTINUE" button
that should block until one of the buttons is clicked.
-Steve
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/