title: Login form submit button does not work
body: <p>I've created a simple one word password login using PHP. The password is stored in the php file - I know this isn't massively secure but all I want is for people to not be able to wander into the site.</p>
  
  <p>For the sake of testing the password is <strong>password</strong></p>
  
  <p>You can see that I have a jQuery shake effect when it is wrong.</p>
  
  <p><strong>My Question:</strong></p>
  
  <p><em>Why does my submit button not work with the correct password on hitting the submit button and why does hitting <strong>return</strong> behave differently to the submit button?</em></p>
  
  <p>My code:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
    &lt;head&gt;
  
      &lt;script type="text/javascript" src="js/jquery-1.3.2.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="js/vibrate.js"&gt;&lt;/script&gt;
  
    &lt;/head&gt;
    &lt;body&gt;
  
        &lt;!-- body content --&gt;
        &lt;div class="wrapper"&gt;
  
            &lt;!-- container --&gt;
            &lt;div class="container"&gt;
  
              &lt;div class="col-lg-12"&gt;
                  &lt;div id="login" class="form-wrapper content-flood"&gt;
                      &lt;form action='php/login.php' method="post" class="login-form" id="loginform"&gt;
                            &lt;h3 class="text-center"&gt;Enter your password:&lt;/h3&gt;
                            &lt;input type="password" name="password"&gt;
                            &lt;input type="button" name="Submit" id="submit_butt" value="Submit" formaction="php/login.php"/&gt;
                      &lt;/form&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  
            &lt;/div&gt;
            &lt;!-- end container --&gt;
  
        &lt;/div&gt;
        &lt;!-- end body content --&gt;
  
  &lt;script type="text/javascript"&gt;
  
  $(document).ready(function() {
  
      $("#submit_butt").click( function() {
  
          // configurations for the buzzing effect. Be careful not to make it too annoying!
          var conf = {
                  frequency: 5000,
                  spread: 5,
                  duration: 600
              };
  
          /* do your AJAX call and processing here...
              ....
              ....
          */
  
          // this is the call we make when the AJAX callback function indicates a login failure 
          $("#login").vibrate(conf);
  
          // let's also display a notification
          if($("#errormsg").text() == "")
              $("#loginform").append('&lt;p id="errormsg"&gt;Oops, wrong password!&lt;/p&gt;');
  
          // clear the fields to discourage brute forcing :)
  
          $("#pwd").val("");
      });
  
  });
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>PHP:</p>
  
  <pre><code>&lt;?php
  // this password may come from any source.
  // it's a variable for the sake of simplicity
  
  $password = 'password';
  
  if($_POST['password'] == $password){
    $_SESSION["userid1"] = $id1;
  header("Location: ../home.html"); // redirects
  }else{
  
  }
  ?&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>jQuery.fn.vibrate = function(conf) {
          var config = jQuery.extend({
                  speed: 30, 
                  duration: 2000, 
                  frequency: 10000, 
                  spread: 3
          }, conf);
  
          return this.each(function() {
                  var t = jQuery(this);
  
                  var vibrate = function() {
                          var topPos = Math.floor(Math.random() * config.spread) - ((config.spread - 1) / 2);
                          var leftPos = Math.floor(Math.random() * config.spread) - ((config.spread - 1) / 2);
                          var rotate = Math.floor(Math.random() * config.spread - (config.spread - 1) / 2); // cheers to erik@birdy.nu for the rotation-idea
                          t.css({position: 'relative', left: leftPos +'px', top: topPos +'px', WebkitTransform: 'rotate(' +rotate +'deg)', WebkitTransform: 'rotate(0deg)'});
                  };
  
                  var doVibration = function () {
  
                          var vibrationInterval = setInterval(vibrate, config.speed);
  
                          var stopVibration = function() {
                                  clearInterval(vibrationInterval);
                                  t.css({position: 'static'});
                          };
  
                          setTimeout(stopVibration, config.duration);
                  };
  
                  /* 
                      Mofication by Kishore - I am commenting out the following line as it calls the vibration function repeatedly.
                      We need to call it only once. So, instead I make a call to doVibration() directly.
                  */
  
                  //setInterval(doVibration, config.frequency);
                  doVibration();
          });
  }
  </code></pre>
  
  <p>;</p>
  
  <p>EDIT: I'm leaving 'else' in the PHP empty becuse the jQuery is handling the error?</p>
  
  <p>I couldn't get a JSFIDDLE of this working but here is the site in action (which is also a test version).</p>
  
  <p><a href="http://hea.getevent.info/" rel="nofollow">http://hea.getevent.info/</a></p>