Reputation:
I have a problem with the Chosen jQuery plugin. When I try to search for a string which has space in it I get no results even if it does exist.
For example: If I enter the string "and barbu" I don't get anything back. But when I write "antigua and barbu" I get the result.
What should I do to fix this space problem?
Upvotes: 10
Views: 7098
Reputation: 2010
Answer here : Changing search behavior in jquery plugin Chosen Just need to add
jQuery('select').chosen({search_contains:true}) ;
As mentionned on the options doc : http://harvesthq.github.io/chosen/options.html
search_contains false By default, Chosen’s search matches starting at the beginning of a word. Setting this option to true allows matches starting from anywhere within a word. This is especially useful for options that include a lot of special characters or phrases in ()s and []s.
Upvotes: 28