Reputation: 12846
I am implementing chosen dropdown in my project. But I have some problem which I want to solve.
Before proceeding, let me give you the jQuery fiddle:
http://jsfiddle.net/jHvmg/278/
Now I have a dropdown like this
<select id="drp_menu">
<option value="Option 1">Option 1</option>
<option value="Option 2">Option 2</option>
<option value="Option 3">Option 3</option>
<option value="Option 4">Option 4</option>
<option value="Option 5">Option 5</option>
</select>
As you can see in the fiddle:
1) If I write "Opt"
in the searchbox then the list is filtered showing all the options.
2) If I write " 1"
it shows "Option 1"
3) If I write "1"
it shows "Option 1"
4) If I write "ptio"
then it states "No results"
5) If I write "tio"
then it states "No result"
I want to results if words typed in the searchbox matches.
Upvotes: 1
Views: 410
Reputation: 407
Replace
$('#drp_menu').chosen();
with
$('#drp_menu').chosen({search_contains:true});
Just look for the documentation for configuration options
like this
Upvotes: 1