Can Chosen.js look for parameter values ​​as well as their text?

I am using the jQuery Chosen.js plugin with a long list of options. Sometimes people look for abbreviations that appear in the value attribute, but not in the human-readable text displayed for the option . Is there a way to instruct Chosen.js to look up values ​​as well as text options?

For example, given this option in the selection box ...

 <option value="TX">Texas</option> 

... I want Chosen.js to display this option, even if the user simply types "tx" and nothing else. By default, neither Chosen.js nor Select2 show the result in this case.

+4
source share
1 answer

Select2 matcher from ivaynberg.imtqy.com/select2/#matcher supports matching values ​​with both option text and the corresponding value.

The solution has already been mentioned in the comments, adding this answer to remove this question from the queue that has not been queued.

0
source

Source: https://habr.com/ru/post/1489507/


All Articles