开发者

Jquery autocomplete wildcard

开发者 https://www.devze.com 2023-03-22 21:35 出处:网络
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 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 's开发者_运维技巧tart with' what you already typed.

I can't find any documentation on this though.

Anyone have any experience with this?

Much appreciated.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消