title: Form not submitting when pressing enter
body: <p>I have the following HTML/JS/jQuery Code. This code represents a login form that is presented modally to the user to allow them to login. The problem is, when I hit enter, the form does not seem to execute the "onsubmit" event. When I click the button as the bottom of the form (which has virtually the same code as the onsubmit event), it works perfectly. I am wondering if anyone can tell me why this form isn't submitting..? Any assistance would be appreciated.</p>
  
  <p><strong>jQuery Code to Show Login Modal:</strong></p>
  
  <pre><code>showDivAndFocus('loginModal','loginaccount'); 
  
  function showDivAndFocus(v,t){
  
      if (api)
          if (api.isOpened)
              api.close();
  
      api = $('#'+v).overlay({
          mask: {color: '#000000'}, 
          top:'0px',
          api: true,
          autoScrollToActive: false,
          autoScrollOffset: 0 
      }).load();
  
      document.getElementById(t).focus();
  }
  </code></pre>
  
  <p><strong>HTML Code</strong></p>
  
  <pre><code>&lt;div class="modal" id="loginModal"&gt;
      &lt;h2&gt;User Login&lt;/h2&gt;
      &lt;br /&gt;
  
      &lt;form action="javascript:void(0);" onsubmit="return(doLogin());"  name="loginForm" id="loginForm"&gt;
          &lt;table width="95%" cellpadding="4" cellspacing="4"&gt;
          &lt;tr&gt;
          &lt;td class="regw" align="left"&gt;&lt;b&gt;Account Number:&lt;/b&gt;&lt;/td&gt;
          &lt;td class="regw" align="left"&gt;&lt;input type="text" maxlength="10" size="10" name="loginaccount" id="loginaccount" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
  
          &lt;tr&gt;
          &lt;td class="regw" align="left"&gt;&lt;b&gt;Username:&lt;/b&gt;&lt;/td&gt;
          &lt;td class="regw" align="left"&gt;&lt;input type="text" maxlength="20" size="20" name="loginusername" id="loginusername" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
  
          &lt;tr&gt;
          &lt;td class="regw" align="left"&gt;&lt;b&gt;Password:&lt;/b&gt;&lt;/td&gt;
          &lt;td class="regw" align="left"&gt;&lt;input type="password" maxlength="20" size="20" name="loginpassword" id="loginpassword" /&gt;&lt;/td&gt;
          &lt;/tr&gt;  
  
          &lt;tr&gt;
          &lt;td class="regw" align="left"&gt;&lt;b&gt;Remember Me:&lt;/b&gt;&lt;/td&gt;
          &lt;td class="regw" align="left"&gt;&lt;input type="checkbox" name="loginremember" id="loginremember" /&gt;&lt;/td&gt;
          &lt;/tr&gt;  
  
          &lt;tr&gt;&lt;td colspan="2"&gt;
              &lt;div&gt;  
                  &lt;center&gt;
                      &lt;table&gt;&lt;tr&gt;&lt;td width="50" valign="middle"&gt;
                          &lt;div id="loginLoading" style="height:24px;width:24px;"&gt;&lt;/div&gt;   
                      &lt;/td&gt;&lt;td&gt;
                          &lt;button onclick="doLogin();" type="button" class="ok"&gt;Submit&lt;/button&gt;
                      &lt;/td&gt;&lt;td&gt;
                          &lt;button onclick="api.close();" type="button" class="cancel"&gt;Cancel&lt;/button&gt;
                      &lt;/td&gt;&lt;td width="50"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
                  &lt;/center&gt;
              &lt;/div&gt;
          &lt;/td&gt;&lt;/tr&gt; 
          &lt;/table&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>AJAX Call</strong></p>
  
  <pre><code>function doLogin(){
      var ajax = getXmlObject();
      var f = getFormVariables();
      var url= '/login.php?f=' + encodeURIComponent(f);
      if (ajax.readyState == 4 || ajax.readyState == 0) {
          ajax.open("POST", url, true);
          ajax.onreadystatechange = function () {
              if (ajax.readyState == 4) {
                  var a = ajax.responseText;
                  if (a=="OK"){...} else {...}
              }
          };
          ajax.send(null);
        }
        return false;
   }
  </code></pre>