I want to call a function when submit finish. The submit open a pdf in a new tab.
$(form).submit() // fire the submit
but when I tried this approch
$(form).submit(function(e){
callfunction();
}
);
The submit doesn't fire.
Here is my code.
<form id="form" action="#" method="post" target="_blank">
<input type="hidden" name="docId">
</form>
function getSubmitAttribute(data) {
$form = $("#form");
$(form).find("input[name=docId]").val($(data).parent().attr('id'));
return form;
}
$('#datable tbody').on('click', '.cell', function () {
form = getSubmitAttribute($(this));
$(form).attr('action', url);
$(form).submit();
}
Thank you.