title: Hide/Show validation form issue
body: <p>I want to make a simple validation form, but ive got a little error i cant fix. After I click on a login element I want a login_window appear(change from display:none to display:block) After that I want login and password inputs to show up. When I fill that up with anything else than "username" and "password" it should show me the alert message. Instead of that it keeps hiding the login_window even when there is no form(I just click submit and the login_window is hidden)  </p>
  
  <p>HTML:
      </p>
  
  <pre><code>&lt;div id="login_window"&gt;
      &lt;form name="login_form" onsubmit="return validate_login()" method="post"&gt;
          &lt;label&gt;Login&lt;/label&gt;
          &lt;input type="text" name="usr" placeholder="username"&gt;&lt;br&gt;
          &lt;label&gt;Sign In&lt;/label&gt;
          &lt;input type="text" name="psw" placeholder="password"&gt;&lt;br&gt;
          &lt;input type="submit" value="Submit"&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>#login {
      position:absolute;
      width:65px;
      height:26px;
  }
  
  
  #login_window {
      position:absolute;
      width:400px;
      height:460px;
      background-color:#F0F0F0  ;
      z-index:2;
  }
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>var login = document.getElementById("login");
  var login_window = document.getElementById("login_window");
  login_window.style.display = "none";
  
  login.addEventListener("click",function(){    
      login_window.style.display = "block";
  });
  
  
  function validate_login(){
      var un = document.login_form.usr.value;
      var pw = document.login_form.psw.value;                                           
      var username = "username";
      var password = "password";
      if((un == username) &amp;&amp; (pw == password)){
          return true;
      }else{
          alert("Login was unsuccesful, please enter the corrent name and password.");
          return false;
      }    
  }
  </code></pre>
  
  <p>Here's the <a href="http://jsfiddle.net/xbf6zngo/" rel="nofollow">Fiddle</a></p>
  
  <p>Even though it works differently in the fiddle than it does in my browser, I have two questions.</p>
  
  <p>1) Why is the login_window keeps hiding whenever I click submit?</p>
  
  <p>2) Why isnt my validation form working?</p>
  
  <p>Thank you</p>