I load the form into the jquery ui dialog. I have a submit button ( inside my form - NOT the actual dialog buttons ) that triggers the controller action, but I cannot figure out how to close the dialog after the submit call, since I don't have an event handler that I attach.
is there anything to do besides changing the submit to input type = button?
I know that in jquery I can capture submit
$('#positionForm').submit(function () {
return true;
});
but it looks like a fire before sending, so I donβt want to close the dialog yet.
There is something wrong with the code below:
$('#positionForm').live('submit', function () {
$.post('/MyController/Action', $("#positionForm").serialize(), function (data) {
alert(data);
}, "html");
closeModalPopup();
return false ;
});
leora source
share