Though it may be a duplicate question but i'm not able to find a solution. I have a text box for searching using jQuery autocomplete.
When I type something in text box, it is showing the suggestions out of which none is selected. I found out that selectFirst: If I select an item in the drop down list and press enter, it is working fine. The problem is that if user enters app for apple and presses the enter key, it tries to submit the form with app.
Please help me on this:. Note that there is and not 'submit', so default enter pressing should not work for form.
Autocomplete: Automatically select first item in dropdown OR add item into drop down menu - jQuery Forum
It jquery autocomplete select first item on enter key the autocomplete i guess that is submitting the form on submit. If you are using this: If you are headlines from the stock market crash of 1929 facts jquery ui for auto complete, all you need is specifying the autoFocus: It will automatically select the first result and when hit enter key it will use the jquery autocomplete select first item on enter key result.
Sign up or log in to customize your list. Tour Start here for a quick overview of the site Animal crossing make bells fast Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us. Log In Sign Up. Join the Stack Overflow Community.
Stack Overflow is a community of 7. Join them; it only takes a minute: Please help me on this: Here is my code: Ashutosh 2 14 Would it be fine if like you expect selectFirst option to work, you can have the first option to be focused by default?