title: Switching my form submit to ajax-can I just change onsubmit action?
body: <p>I see lots of jquery tutorials from building the submit form from scratch, and that is cool, but I'm wondering if I can convert my existing form.</p>
  
  <p>I'm using a typical form, and already have an email and blank values checking in place.  Right now, on submitting the form, the user is taken to the confirmation php page withing form-submit.php.</p>
  
  <p>I'd like to change that to just giving a user a line on the current page "Your form has been submitted"</p>
  
  <p>Here is my form:</p>
  
  <pre><code>&lt;form name="theForm" action="/contact-form2.php" method="post" onsubmit="return formCheck(this);" &gt;
  &lt;table class="formTable" cellpadding="3" cellspacing="0"&gt;
    &lt;tbody&gt;&lt;tr&gt;
      &lt;td align="left"&gt;&lt;b&gt;Name:&lt;/b&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input name="name" id="name" size="25" value="" type="text" /&gt;&lt;/td&gt;
     &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td align="left"&gt;&lt;b&gt;Email:&lt;/b&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input name="email" id="email" size="25"  type="text" /&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td align="left"&gt;&lt;b&gt;Confirm Email:&lt;/b&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input name="email_confirm" id="email_confirm" size="25"  type="text" /&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td align="left"&gt;&lt;b&gt;Subject:&lt;/b&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input name="Subject" id="subject" size="35" value="" type="text" /&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td align="left" valign="top"&gt;&lt;b&gt;Message:&lt;/b&gt;&lt;/td&gt;
      &lt;td&gt;&lt;textarea name="Message" id="message" cols="30" rows="6"&gt;&lt;/textarea&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr align="left"&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;input type="submit" value="Submit" onclick=" return checkEmail();" /&gt;&amp;nbsp;&lt;input type="reset" value="Reset" /&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>So is it possible to just change the on submit or onclick to be able to both submit the form through the external php file, and stay on the same page?</p>