jQuery simulate form submit

Sam Deering
Tweet

Simple jQuery snippet to simulate a form submit.

$("#myform").submit();

or using raw JavaScript (on element):

this.form.submit();

Free JavaScript: Novice to Ninja Sample

Get a free 32-page chapter of JavaScript: Novice to Ninja and receive updates on exclusive offers from SitePoint.

  • Sana Talha
  • The Real Sam

    How would you go about fully simulating the form post in a page with out a html form.
    Example: Submitting from a js bookmaklet.