title: Call php in HTML form on action but don't redirect
body: <p>I have an HTML form as follows:</p>
  
  <pre><code>&lt;form id="ContactForm" name="ContactForm" method="post" action="emailinfo.php"&gt;
  </code></pre>
  
  <p>and then a submit button that calls <code>verify()</code>:</p>
  
  <pre><code>&lt;a href="#" class="button1" onClick="verify()"&gt;Send&lt;/a&gt;
  </code></pre>
  
  <p><code>verify</code> is defined as such:</p>
  
  <pre><code>function verify() {
      if(document.getElementById("name").value=="" || document.getElementById("email").value=="") {
          alert("Please enter a name and an email.");
      } else {
          alert("Looks good, sending email");
          document.getElementById('ContactForm').submit();
      }
  }
  </code></pre>
  
  <p>Currently, when I click the submit button, the browser redirects to <code>emailinfo.php</code>, which is just a blank white screen because that <code>php</code> file just sends off an email and does nothing else. How can I run that <code>php</code> file without redirecting to it?</p>