title: Onsubmit still submits when returning false
body: <p>I'm having a problem with a simple html login page I made, where when I submit the login form with invalid credentials the form still submits, even though my validation method is executing the "return false" command. I know that this question has been asked a multitude of times here, but none of the answers to those questions have helped me.</p>
  
  <p>My html form is as follows:</p>
  
  <pre><code>&lt;form onSubmit="return validateForm();" method="get" action="TestPage.html"&gt;
      &lt;div id="centralPoint" class="frame"&gt;
          &lt;select id="centralPointSelect" data-inline="true" data-mini="true" data-native-menu="false" name="centralPoint"&gt;&lt;/select&gt;
      &lt;/div&gt;
      &lt;div id="credentialsFrame" class="frame"&gt;
          &lt;input id="userField" type="text" name="Username" /&gt;
          &lt;input id="passField" type="password" name="Password" /&gt;
      &lt;/div&gt;
      &lt;div id="errorMsg"&gt;&lt;/div&gt;
      &lt;input id="loginBtn" type="submit" value="Login" /&gt;
      &lt;div id="rememberMe" class="frame"&gt;
          &lt;input type="checkbox" id="checkbox-1" class="custom" data-mini="true" name="rememberMe" /&gt;
          &lt;label for="checkbox-1"&gt;Keep me signed in&lt;/label&gt;
      &lt;/div&gt;
      &lt;div id="forgotPassFrame"&gt;
          &lt;input id="forgotPass" type="button" data-mini="true" value="Forgot password?" /&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And here is my javascript method. Note that even if the only line of code in here is "return false;" the form still submits. I've also checked in firebug to  make sure that the method is actually being called and that it is indeed returning false, and it all checks out.</p>
  
  <pre><code>function validateForm()
  {
      var usernameTxt = $("#userField").attr("value");
      var passwordTxt = $("#passField").attr("value");
  
      if (usernameTxt == "" || passwordTxt == "" || (usernameTxt == userLbl &amp;&amp; passwordTxt == passLbl))
      {
          $("#errorMsg").html("Please enter a username and password.");
          return false;
      }
  }
  </code></pre>
  
  <p>Is there something really obvious that I'm missing? I'm not binding the onsubmit event in any way other than what you can see in the html form tag, nor am I assigning any click handler to the submit button. </p>
  
  <p>It might be relevant that I'm using JQuery mobile, is it possible that this is doing something with my form?</p>