I'm realizing that I didn't describe this completely enough. I'm putting together a search engine. So I need text field (with autocomplete) and a Search button. When the user presses return, it should submit the form (i.e. the equivalent of clicking the Search button). When the user explicitly selects a value from the autocomplete drop-down, I want the text field to be updated with that value and the form to be submitted.
If the user has typed something and presses return, the form should be submitted, but the auto complete code should not update the text field's value, since the user didn't explicitly select the autocomplete's value. Is this do-able? On Wed, Sep 30, 2009 at 12:22 PM, mikewertheim <m...@hyperreal.org> wrote: > > I'm using the jquery autocomplete plugin. > > Suppose the user starts typing, and the autocomplete presents a drop- > down of possible values. If the user presses return, the first value > in the drop-down is selected. > > What I want instead is the user experience that Firefox's search box > provides: As the user types, search suggestions are offered. If the > user presses return without selecting a suggestion, what the user has > typed so far is submitted. And of course, if the user does explicitly > select a value from the drop-down, then the selected value is > submitted. > > Is there a way to make jquery autocomplete do that? >