Skip to content

Instantly share code, notes, and snippets.

@bulbul84
Created August 7, 2015 21:08
Show Gist options
  • Save bulbul84/b0d8565ccf1c7cf6dbeb to your computer and use it in GitHub Desktop.
Save bulbul84/b0d8565ccf1c7cf6dbeb to your computer and use it in GitHub Desktop.
// How to show loading-div after submitting a form with jQuery?
$('.formtrigger').click(function() {
$('#loading').show();
$('#form').submit();
});
/*When I click the button, the form is submitted, but the loading-div doesn't appear.
I tried the line "$('#loading').show();" without binding it on the click-event and it worked. I also tried this code: */
$('.formtrigger').click(function() {
alert('blablabla');
$('#form').submit();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment