Yeah, I thought of using that or greybox but I'm already using blockUI and I'm trying to minimize the number of packages that I require.
I would also like to understand why the simple test case works but fails when integrated into my application. Is this a bug or more likely a fundamental misunderstanding of how this tool works. For example, reading through the code it is not obvious to me how the function $.blockUI() blocks continued execution of javascript until the ok button is clicked. I know this is done with events, but I'm not seeing the pattern of how this happens. -Steve Christopher Jordan wrote: > Try the ThickBox plug-in. It's meant just for that sort of thing. :o) > > Cheers, > Chris > > Stephen Woodbridge wrote: >> 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/ >> >> > _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/