3

I am using the jquery.ui.autocomplete plugin, but I noticed when it searches, it uses a wild-card like this '%value%'.

I am using the auto-complete for zip-codes, and I think it would make more sense of the wild-card worked like this 'value%' so when you start typing it only filters out the items that 'start with' what you already typed.

I can't find any documentation on this though.

Anyone have any experience with this?

Much appreciated.

Haim Evgi
  • 123,187
  • 45
  • 217
  • 223
Nealv
  • 6,856
  • 8
  • 58
  • 89

1 Answers1

3

You can use a function as the source option for the autocomplete plugin which should allow you to get the behaviour you want.

There's a very similar question asked here: jQuery UI Autocomplete widget search configuration which has an excellent answer and working example.

Community
  • 1
  • 1
KevD
  • 697
  • 9
  • 17