title: Using JQuery Autocomplete combobox
body: <p>Im trying to use this JQuery code in my program: <a href="http://jqueryui.com/demos/autocomplete/#combobox" rel="nofollow noreferrer">http://jqueryui.com/demos/autocomplete/#combobox</a></p>
  
  <p>Its basically a combo-box which has a auto-complete field and a dropdown button. </p>
  
  <p>When I try to use my combo box inside form tags, it doesnt work properly - the dropdown button keeps submitting the form when i just want to look up values.</p>
  
  <p>The original code from the example is the following:</p>
  
  <pre><code>$( "&lt;button&gt;&amp;nbsp;&lt;/button&gt;" )
              .attr( "tabIndex", -1 )
              .attr( "title", "Show All Items" )
              .insertAfter( input )
              .button({
                  icons: {
                      primary: "ui-icon-triangle-1-s"
                  },
                  text: false
              })
              .removeClass( "ui-corner-all" )
              .addClass( "ui-corner-right ui-button-icon" )
              .click(function() {
                  // close if already visible
                  if ( input.autocomplete( "widget" ).is( ":visible" ) ) {
                      input.autocomplete( "close" );
                      return;
                  }
  
                  // pass empty string as value to search for, displaying all results
                  input.autocomplete( "search", "" );
                  input.focus();
  
              });
  </code></pre>
  
  <p>Any help appreciated :).</p>