I’m using rails3-jquery-autocomplete gem. It works perfectly, but I don’t know how to implement a redirect on selection of a result. All it does now is populate the field with the text of the selected result. Thanks!
I’m using rails3-jquery-autocomplete gem. It works perfectly, but I don’t know how to implement
Share
The best way to perform re-direct when a user selects one of the drop down items from the autocomplete list when using rails3-jquery-autocomplete is via the “railsAutocomplete.select” event, which is triggered when the user selects one of the options.
How to do this is documented here. This approach means you can avoid editing the rails3-jquery-autocomplete code, and only causes a re-direct to happen when the user selects from the drop down option, rather than “onChange” of the form field, which isn’t really what you want.