I have a JQuery UI modal that renders a partial MVC view if certain qualifiers exist. In my JavaScript, I only want the form to submit after the modal completes. This is what I have:
$('#btnSaveAndSend').click(function (e) {
var result = _fieldsAreValid($('#validation').val() === "y");
if (result) {
if (showPrompt) {
$('#divPrompt').dialog({
autoOpen: true,
width: 500,
height: 225,
modal: true,
draggable: false,
resizable: false,
title: "Modal",
open: function (event, ui) {
$(this).load("/Home/SendEmail");
}
});
}
$("#form").submit();
}
});
Without AJAX, is there any way to do this?