Forum Documentation Showcase Pricing Learn more

Autocomplete Search Results Select


#1

Hi
I have put together an autocomplete for a search input.

At this point I want to make it so that when the autocomplete results appear, the user can click on the result and it will subsequently fill in the search input with the value of the cell clicked.

I have attached an image of the page functioning. What I’d like is to make it so a person could click on boston and the input value would be changed from b to boston.

Cheers


#2

Are the images so important to the search, that you can’t use the built in Autocomplete ?

That does what you want it to do.


#3

Hi Nigel,

The built in autocomplete is being used. It is a plugin and is functioning correctly, despite the image being present in the results. This is because the image is in the repeating group next to the text. So when the current cell is displayed it shows the image and the text associated with the city name in the database.

What I am having difficulties with is making it so that a user can click on the cell in the repeating group of the city name so that the name of the city could then be automatically passed to the input field.

For example, a user inputs the letter B and then three different cities are displayed that start with the letter B. Instead of needing to fill out the remainder of the text in the input field, I’d like for the user to be able to select the name from the list which will then get displayed in the input field. So they click Boston from the list and then Boston will be displayed in the input field.


#4

I see, gotacha.

What you can do is put the input in a group, then set the input’s initial value to be the group’s value. Initially it will be blank, but when they select something you can set the group value and then reset the input.


#5

Thanks Nigel! Worked like a charm.

I have attached photos for future users who may have the same issue.