views:

47

answers:

1

Does anyone know if theres a jquery autocomplete library that works similar to the one here: http://www.thetrainline.com

(try and select a station to see what i mean) The one on here is a prototype library. Basically all the ones ive found will only match characters if they appear at the beginning of a string, for example, if i typed 'ear' it would not match the word 'hear'. However this one seems to do that.

If anyone has any ideas id be very grateful.

+2  A: 

You can use the jQuery Autocomplete plugin, which gives you the option of preloading all the possible data or using a server-side backend for finding matching results.

Use the matchContains option to match results that contain, rather than just begin with, the search string.

Aaron
Thats what im using already, but it only matches characters at the beginning of a string, unless there a config option im missing?
richzilla
Yes, the option `matchContains` is what you're looking for. See the `autocomplete` function documentation and look at the options list for more details. Updated answer to include this.
Aaron