By mshaver on
Is there a way to make an autocomplete field submit once the option is selected? I know this only works with a single field type scenario. Currently how it works is you select the option from the drop down list and then you have to select the submit button. If doing this with your keyboard, you essentially have to hit "enter" twice. Some users have complained about this.
Any information would be great. Thanks.
Comments
issue queue
#309088: In autocomplete textfield, have to hit enter once to accept autocomplete, another time to submit form
I too found it annoying that
I too found it annoying that it's so EASY to get an autocomplete on the page, and yet it doesn't behave like I would expect a single field autocomplete to work.
The following javascript worked for me in Drupal 7:
Put it in a file and load it with your theme. Note that it will interfere with multiple entry autocompletes, such as tags. If you're using those too, then be more selective about which pages you include the script on. I did it via a form alter on the search form: