I have created a submit function for each form created on my application. It's similar to the one written below.
$('form').submit(function(){
//Some variable declaration
$.ajax({
type:'post',
url:'someurl',
data:formdata
success:function(){
console.log('form submitted');
}
});
});
No doubt this works fine. Now for one of the forms I want to update a certain element after the response is received, similar to this.
$('#customform').submit();
console.log('custom form submitted');
So in this case I want the message "custom form submitted" to be printed only after 'form submitted' message is printed to the console (Synchronous loading). Anyone to help?