How To Do Things After Form Submit With JQuery

Posted by Weston Ganger on March 27, 2016

I wanted an easy to manipulate the DOM after form has been submitted via javascript for example adding a fake loading bar.

You can do this using jQuery submit.

  e.preventDefault(); // dont submit multiple times
  this.submit(); // use native js submit


Note: If you do not cancel the event and then use js submit then the actions will be performed before the forms submission. Note 2: If you do not use setTimeout() it will do the work before submission in Chrome which you do not want.

Related External Links:

Posted in Javascript and Tagged with jquery javascript forms 

Want me to help develop your next project or application?

Contact Us

Specializing in Ruby-on-Rails, Javascript, Multi-Platform Electron Desktop Apps and Hybrid Cordova Mobile Apps.

Recommended Posts