I have Posts tied to a location so when I make jQuery autocomplete on that location field results with same name appear in the dropdown.
For example:
If there are 10 posts with location Berlin and I start typing the city name the autocomplete will give me the name of the location multiplied by the number of posts. I was wondering if there is a way to group location names using jQuery.
Thanks
This jquery ui demo is similar to your requirement.
The original data:
you can change them to
To retrieve the value
And http://jqueryui.com/autocomplete/#custom-data
is a demo about custom data format of dropmenu
I hope this sample helpful.