I found this code very useful, I was wondering if there is a possibility to add a button to show all the results

Yes there is.

The autocomplete documentation shows in the Options section that there's a minLength setting, which says:

The minimum number of characters a user has to type before the Autocomplete activates. Zero is useful for local data with just a few items. Should be increased when there are a lot of items, where a single character would match a few thousand items.

That can be used with something from the Methods section of the documentation called search, which says:

Triggers a search event, which, when data is available, then will display the suggestions; can be used by a selectbox-like button to open the suggestions when clicked. If no value argument is specified, the current input's value is used. Can be called with an empty string and minLength: 0 to display all items.

solidus_it
—
2012-03-22T11:31:56Z —
#3

thanks for your quick answer,I also thought that, unfortunately my knowledge in javascript is very poor, can you show me a sample how to add a button, to call the procedure to show all results?

thanksSolidus

Paul_Wilkins
—
2012-03-22T11:37:08Z —
#4

solidus_it said:

thanks for your quick answer,I also thought that, unfortunately my knowledge in javascript is very poor, can you show me a sample how to add a button, to call the procedure to show all results?

An example, after you've already initialised the autocomplete with a minLength of 0, might be something like: