title: widget for implementing auto complete for search engine
body: <p>I'm putting together a search engine.  I need a text field (with autocomplete) and a Search button.  (Clicking the Search button submits the form.)</p>
  
  <p>There are many javascript autocomplete solutions out there (some are listed at <a href="http://webtecker.com/2008/03/10/10-auto-complete-ajax-scripts" rel="nofollow noreferrer">http://webtecker.com/2008/03/10/10-auto-complete-ajax-scripts</a>), but I need one that works in tandem with the Search button.</p>
  
  <p>Specifically, I'm looking for a javascript widget that mimics the functionality provided by Firefox's search bar...  When the user types in the text field, the autocomplete presents suggestions in a drop-down.  If the user presses Enter (e.g. without touching the drop-down), then the form is submitted (as if the Search button was clicked), and what the user typed into the text field is the value that is submitted to the form.  Alternatively, if the user selects a value from the autocomplete drop-down (either via keyboard or mouse), then the text field's value is set to the autocomplete selection, and the form is submitted (as if the Search button was clicked).</p>
  
  <p>I already have the server-side back-end code that generates the autocomplete suggestions.</p>