title: Why does forms with single input field submit upon pressing enter key in input
body: <p>Why is it that a <code>&lt;form&gt;</code> with a single <code>&lt;input&gt;</code> field will reload the form when the user enters a value and presses the <kbd>Enter</kbd>, and it does not if there are 2 or more fields in the <code>&lt;form&gt;</code>?.</p>
  
  <p>I wrote a <a href="http://testformenter.html?partid=123" rel="noreferrer">simple page</a> to test this oddity.</p>
  
  <p>If you enter a value in the second form and press Enter, you'll see it reloads the page passing the entered value as if you called <code>GET</code>. why? and how do I avoid it?</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;testFormEnter&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form&gt;
    &lt;input type="text" name="partid2" id="partid2" /&gt;
    &lt;input type="text" name="partdesc" id="partdesc"  /&gt;
  &lt;/form&gt;
    &lt;p&gt;2 field form works fine&lt;/p&gt;
  &lt;form&gt;
  &lt;input type="text" name="partid" id="partid"  /&gt;
  &lt;/form&gt;
  &lt;p&gt;One field form reloads page when you press the Enter key why&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>