title: jQuery Autocomplete: Hitting return submits the form
body: <p>I am using the jQuery Autocomplete plugin.</p>
  
  <pre><code>// I'm not sure if there's a better way to do this
  
  var base_url = window.location.href.slice(0, window.location.href.indexOf('/bar'));
  $('.foo-widget').find('input:first-child').autocomplete(base_url + "/api/baz?format=newline");
  </code></pre>
  
  <p>The markup:</p>
  
  <pre><code>&lt;ul class="foo-widget"&gt;
      &lt;li&gt;
          &lt;input value="" autocomplete="off" class="ac_input"&gt;&lt;input value="" autocomplete="off" class="ac_input"&gt;&lt;button&gt;Add&lt;/button&gt;
     &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>This works fine. However, when I hit "enter" to choose an item from the autocomplete results, the form submits. Why might this be happening?</p>
  
  <p>I looked into <strong>jquery.autocomplete.js</strong> and saw that the following is being executed:</p>
  
  <pre><code>        case KEY.RETURN:
              if( selectCurrent() ) {
                  // stop default to prevent a form submit, Opera needs special handling
                  event.preventDefault();
                  blockSubmit = true;
                  return false;
              }
              break;
  </code></pre>
  
  <p>Shouldn't <code>event.preventDefault()</code> and <code>blockSubmit = true</code> stop the form from submitting? Is it possible that JS code I have elsewhere on the page is interfering?</p>