title: AJAX: Submitting a form without refreshing the page
body: <p>I have a form similar to the following:</p>
  
  <pre><code>&lt;form method="post" action="mail.php" id="myForm"&gt;
     &lt;input type="text" name="fname"&gt;
     &lt;input type="text" name="lname"&gt;
     &lt;input type="text" name="email"&gt;
      &lt;input type="submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I am new to AJAX and what I am trying to accomplish is when the user clicks the submit button, I would like for the <code>mail.php</code> script to run behind the scenes without refreshing the page.</p>
  
  <p>I tried something like the code below, however, it still seems to submit the form as it did before and not like I need it to (behind the scenes): </p>
  
  <pre><code>$.post('mail.php', $('#myForm').serialize());
  </code></pre>
  
  <p>If possible, I would like to get help implementing this using AJAX,</p>
  
  <p>Many thanks in advance</p>