We are using the Chosen jquery plugin for converting a long options list of the select element into a searchable autocomplete input field.
Is it possible to influence/configure the matching behavior of search terms? Right now Chosen seems to split all option terms into words and performs a prefix search on all words of an option term. The desired behavior we need is to have a prefix search on the option term only. So search for "Island" should match an option like
Island of ....
Island of Hope
Island of Disaster
but not
Easter *Island*s
Today I used Chosen jQuery Plugin and faced the same issue it was searching string in option term prefix.
Searching for the solution I found it was a registered issue at GitHub.
The solution was using search_contains option.
And I solved the problem by using following configuration.
$("select").chosen({enable_split_word_search:true,search_contains:true});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With