title: Mail-form submits, even after validation fail
body: <p>Trying to get this code to run with a simple validation check on a submit form. The error message pops-up but the form still gets submitted. Could anyone point me in the correct direction.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function validateForm() {
    //Validate Name
    var title = $("#name").val();
    if (title == "" || title == null) {
      alert("Please enter");
      return false;
    }
    //Validate Title
    var title = $("#title").val();
    if (title == "" || title == null) {
      alert("Please enter");
      return false;
    }
    //Validate Company
    var title = $("#company").val();
    if (title == "" || title == null) {
      alert("Please enter");
      return false;
    }
    // Validate Email
    var email = $("#email").val();
    if ((/(.+)@(.+){2,}\.(.+){2,}/.test(email)) || email == "" || email == null) {} else {
      alert("Please enter");
      return false;
    }
    return true;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;form name="contactform" method="POST" action="contact.php" onsubmit="return validateForm()"&gt;
    &lt;input type="text" placeholder="Name :" id="name" name="name"&gt;
    &lt;input type="text" placeholder="Title :" id="title" name="title"&gt;
    &lt;input type="text" placeholder="Company :" id="company" name="company"&gt;
    &lt;input type="email" placeholder="Email :" id="email" name="email"&gt;
    &lt;input type="submit" value="Submit" id="sbmt"&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>