29 October 2013

Form submitting is really simple with jQuery. You can use submit function to submit form or catch a form submission and do something else.

Source code viewer
  1. // You can call this from anywhere and the form will be submitted.
  2. $("form").submit();
  4. // Catch form submit, jQuery will catch any form submit and you can rewrite it to do what ever you want.
  5. $("form").submit(function(event) {
  6. alert("You pressed submit.");
  7. event.preventDefault();
  8. });
Programming Language: jQuery