title: Javascript login form doesn't submit when user hits Enter
body: <p>I'm working on a simple javascript login for a site, and have come up with this:</p>
  
  <pre><code>&lt;form id="loginwindow"&gt;
  &lt;strong&gt;Login to view!&lt;/strong&gt;
  &lt;p&gt;&lt;strong&gt;User ID:&lt;/strong&gt;
    &lt;input type="text" name="text2"&gt;
  &lt;/p&gt;
  &lt;p&gt;&lt;strong&gt;Password:&lt;/strong&gt;
  &lt;input type="password" name="text1"&gt;&lt;br&gt;
    &lt;input type="button" value="Check In" name="Submit" onclick=javascript:validate(text2.value,"username",text1.value,"password") /&gt;
  &lt;/p&gt;
  
  &lt;/form&gt;
  &lt;script language = "javascript"&gt;
  
  function validate(text1,text2,text3,text4)
  {
   if (text1==text2 &amp;&amp; text3==text4)
   load('album.html');
   else 
   {
    load('failure.html');
   }
  }
  function load(url)
  {
   location.href=url;
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>...which works except for one thing: hitting enter to submit the form doesn't do anything. I have a feeling it's cause I've used "onclick" but I'm not sure what to use instead. Thoughts?</p>
  
  <hr>
  
  <p>Okay yeah so I'm well aware of how flimsy this is security-wise. It's not for anything particularly top secret, so it's not a huge issue, but if you guys could elaborate on your thoughts with code, I'd love to see your ideas. the code i listed is literally all I'm working with at this point, so I can start from scratch if need be.</p>