Hi
I have got a backend PHP script that calls MySQL in order to get town and city names.
If I type 'cam' in to the autocomplete textfield, I get something like:
Big Camberley
Camberly
Camberwell
Camden
Drone Camden
However the sort order isn't quite what I want. I want the sort order to be:
Camberley
Camberwell
Camden
Big Camberley
Drone Camden
This is because MOST users will want the search to start at the beginning of a place name (i.e. they type 'cam' intending 'Camberley', 'Camberwell' or 'Camden'). I therefore want the values with the match at the start to come first, and any other fields to come after that. But each of these two groups are sorted independently giving the second sort order above.
Is there a 'sort()' callback to do this or a specific option that can be set?
Thanks.