title: Form still submits even with preventDefault
body: <p>I don't know what is wrong here. preventDefault should stop the form from submitting but it still proceeds to. I have an ajax call where it verifies if user is valid. If not, prevent from submitting. Else, proceed to login and home page.</p>
  
  <p><strong>Form</strong></p>
  
  <pre><code>&lt;form id="signIn" method="post" action="processForms.php"&gt;
      &lt;table cellspacing="10"&gt;
          &lt;tr id="errorSignIn" hidden="hidden"&gt;
              &lt;td class="centerItem errorMessage" colspan="3"&gt;
                  Incorrect Username and/or Password
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;input type="text" id="username" name="username" autocomplete="off" autofocus required placeholder="Username..."&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="password" id="password" name="password" autocomplete="off" required placeholder="Password..."&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="submit" name="processButton" class="signIn" value="Sign-in" &gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>Javascript</strong></p>
  
  <pre><code>$('#signIn').submit ( function (e) {
      var username = $('#username').val();
      var password = $('#password').val();
      var dataString = "username=" + username + "&amp;password=" + password;
      $.ajax( {
         type: "POST",
          url: "ajaxCheck.php",
          data: dataString,
          cache: false,
          success: function (result) {
              if (!result) {
                  $('#errorSignIn').removeAttr('hidden');
                  e.preventDefault();
                  return false;
              }
          }
      });
  });
  </code></pre>
  
  <p><strong>ajaxCheck.php</strong></p>
  
  <pre><code>&lt;?php
  $username = $_POST['username'];
  $password = $_POST['password'];
  $password = md5($password);
  $dbConnection = mysqli_connect('localhost','root','','onboard');
  $query =  "SELECT * FROM account WHERE username='$username' AND password='$password'";
  $result = mysqli_query($dbConnection,$query);
  $count = mysqli_num_rows($result);
  if ($count == 1) { echo true; }
  else { echo false; }
  </code></pre>