title: How make enter button (keyboard) work properly in forms in IE8?
body: <p>The problem is only happening in Internet Explorer.  In any other browser I can submit the form by hitting enter on my keyboard, in IE8 I have to actually click the button.</p>
  
  <p>I searched around for fixes for a while and found a few things but it's still not working.  The javascript I'm using should be looking for keycode 13, which is enter, but when I hit enter the field clears itself without submitting the form and the keycode is not triggered.  The keycode thing only returns results for letters and not for shift/enter.</p>
  
  <p>Here's the HTML my current solution:</p>
  
  <pre><code>    &lt;form action="chatscreen.php" name="loginform" method="post"&gt; 
          &lt;p&gt;Please enter your name to continue:&lt;/p&gt; 
          &lt;label for="name"&gt;Name:&lt;/label&gt; 
            &lt;input type="text" name="name" id="name" onkeyup="whichButton("loginform","enter")"/&gt; 
          &lt;button type="submit" name="enter" id="enter" value="Enter"&gt;Button&lt;/button&gt;
      &lt;/form&gt; 
  </code></pre>
  
  <p>And here's the javascript I tried to implement as a fix:</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
      function whichButton(formname,elementname) {
      alert("got a key = " + event.keyCode);
      if (event.keyCode === 13) {
      var followingInput = document.getElementById(elementname);
      document.formname.elementname.click();
      }
      }
   &lt;/script&gt;
  </code></pre>