0

I can't seem to get the option to disable the search functionality using the Chosen plugin working.

I've tried everything from this question without any luck: jQuery Chosen plugin without search field

Sample code:

<select multiple=" " style="width:150px">
  <option value="a">a</option>
  <option value="b">b</option>
  <option value="c">c</option>
  <option value="aa">aa</option>
  <option value="bb">bb</option>
  <option value="cc">cc</option>
</select>

And the jQuery:

$( "select" ).addClass( "chosen-select" ).chosen( 
    { disable_search: true, 
      disable_search_threshold: 50 } 
);

I've tried all combinations of the above options and nothing seems to work. In my example, if I typed the letter 'a' into the search box, I wouldn't expect to see filtered results.

Here's a link to the jsFiddle:

http://jsfiddle.net/ycxb8wm4/3/

Community
  • 1
  • 1
Robert Penridge
  • 8,424
  • 2
  • 34
  • 55

1 Answers1

0

Add this code that hide dropdown div

$( "select" ).next().find( ".chosen-drop" ).hide();

Or use css

.chosen-container .chosen-drop{
  display:none;
}
Neji
  • 198
  • 1
  • 2
  • 7