In a modal jQuery dialog I have form with inputs among them I have upload control.
Due above thing form is marked by enctype = “multipart/form-data”. Form action refers to
controller action that will return partial view that should be placed on a page on callback handling.
To handle submit callback was trying by following (using plugin and simply posting):
var event = jQuery.Event("submit");
e.preventDefault();
$("form:first").trigger(event);
$(this).ajaxSubmit(options);
OR SUCH:
$.ajax({
url: '/Controller/Action',
type: 'POST',
success: function (data) {
$("#divContainer").html(data);
}
});
But these ways are not successfull. No it works like following, without callback handling.
var event = jQuery.Event("submit");
$("form:first").trigger(event);
So, how submit callback can be handled?
Thanks.
MY IS SOLUTION
var options = {
target: '#targetDiv'
};
$('#form').ajaxSubmit(options);
MY IS SOLUTION