title: Enter key form submission fails with HTML5 date input
body: <p>I have a small HTML form (code below) that is effectively in two parts, and I want users to be able to submit the form by pressing the enter key in only one of these parts ("input" in the code below; the display attributes are toggled by a bit of javascript connected to the selection in the second part of the form).  At the moment, I am handling this with a bit of jQuery/javascript (also below) to bind the enter key press to form submission.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;form id="form"&gt;
      &lt;span id="input"&gt;
          &lt;span id="text" style="display:inline"&gt;
              &lt;input type="text"&gt;
          &lt;/span&gt;
          &lt;span id="dates" style="display:none"&gt;
              &lt;input type="date" id="start"&gt;
              &lt;input type="date" id="end"&gt;
          &lt;/span&gt;
      &lt;/span&gt;
      &lt;select onchange="changeInput(this.options[selectedIndex].value)"&gt;
          &lt;option value="1"&gt;option 1&lt;/option&gt;
          &lt;option value="2"&gt;option 2&lt;/option&gt;
      &lt;/select&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And the jQuery/javascript:</p>
  
  <pre><code>$(function(){
      $("#input").on("click", function(e){
          if(e.which == 13){
              $("#form").submit();
          }
      });
  });
  </code></pre>
  
  <p>When the text input is displayed, this works just fine.  When the date inputs are displayed, however, the enter key does nothing.  This is the case whether the browser displays the native calendar widget, or if the inputs are replaced by jQueryUI datepicker widgets in browsers that don't support the date input type (handled by another bit of jQuery/javascript).  </p>
  
  <p>Any idea why this is happening?  I'm aware that I could get around it by adding a hidden submit button and overriding the enter key behaviour for the second part of the form, but I would like to understand what's going on first.</p>