title: Bootstrap modal dialogs with a single text input field always dismiss on Enter key
body: <p>Why does this simple modal dialog with one text field (and NO buttons) dismiss when the focus is on the field and Enter is pressed?</p>
  
  <pre><code>&lt;a href="#dlgAddDeviceFolder" class="add-device-folder" data-toggle="modal"&gt;New Folder&lt;/a&gt;
  
  &lt;div id="dlgAddDeviceFolder" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="dlgAddFolderLabel" aria-hidden="true"&gt;
    &lt;div class="modal-header"&gt;
      &lt;!--&lt;a type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;×&lt;/a&gt;--&gt;
      &lt;h3 id="myModalLabel"&gt;Add Device Folder&lt;/h3&gt;
    &lt;/div&gt;
  
    &lt;div class="modal-body"&gt;
      &lt;form class="form-horizontal"&gt;
        &lt;div class="control-group"&gt;
          &lt;label class="control-label" for="dlgAddDeviceFolder_name"&gt;Folder Name&lt;/label&gt;
          &lt;div class="controls"&gt;
            &lt;input id="dlgAddDeviceFolder_name" type="text" placeholder="Folder Name" autocomplete="off"&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/form&gt;
    &lt;/div&gt;
  
    &lt;div class="modal-footer"&gt;
      &lt;!--&lt;a type="button" class="btn" data-dismiss="modal" aria-hidden="true"&gt;Cancel&lt;/a&gt;--&gt;
      &lt;!--&lt;a id="dlgAddDeviceFolder_btnOk" type="button" class="btn btn-primary"&gt;OK&lt;/a&gt;--&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>There is extensive discussion <a href="https://stackoverflow.com/questions/10400149/avoid-modal-dismiss-on-enter-keypress">here</a> that suggests it is a button issue (I have put type="button" on button and anchor tags.  I have converted button tags to anchors).  However, I tried all solutions proposed and then ended up just completely commenting out the buttons, and it still happens.</p>
  
  <p>Note that if you simply duplicate the same text input and have two fields, the problem goes away (focusing on either text field will not cause dismissal on Enter)</p>