I've bound a function to a form submit button. I want the function to pop up an iframe dialog box and wait for user interaction, and THEN submit the form (via an ajax post).
But the behavior I'm seeing is that the dialog pops but the function continues executing and does the ajax post, even though the dialog box call hasn't returned yet. I need some way of halting the code execution until that dialog function returns.
I have something like:
submitForm: function () {
<call a function that pops up a dialog, doesn't return until user interacts>
new Ajax.Updater('dialogContainer', url, {
...........
}
});
return false;
}
I think this is the expected behavior of javascript but am not sure how to get around it...