Not sure if this has been covered somewhere, but I couldn\'t find it in the documentation, and was wondering if it\'d be possible to not include the search input box with the jQ
With the latest Version of chosen only that works for me:
$('ul.chosen-choices li.search-field').hide();
Use this code to disable it:
jQuery('select').chosen( {disable_search: true} );
and don't forget to hide it, otherwise it will still be working on mobile !
.chzn-search{display: none}
$('select').chosen( {disable_search: true} );
Newer versions of jquery chosen gives you option to disable search input with in dropdown.
$(".chzn-select").chosen({
disable_search: true
});
Older versions do not support this option. Some how if you are strictly not allowed to use newer version than you can use
$(".chzn-select").chosen({
disable_search_threshold: 5
});
it will hide the search box if results are less than 5, best to use with gender type dropdowns. There is another way to fix this and that is;
$(".chzn-select").chosen();
$(".chzn-select").hide();
Call hide immediately after initialization, don't know why this tricks works but it is doing what you want!
I suggest you to use the latest version so you have access to latest options.
Hope it works for you!
Since none of the chosen-settings for hiding the search-field for multiple selects seemed to be working, I hacked the chosen.jquery.js in line 577 to:
<li class="search-field"><span class="placeholder">' + this.default_text + '</span></li>
(Span instead of the input field). Needed to comment out this line, too
this.search_field[0].disabled = false;
Working fine for me - even though its not the best practice to hack the code.
disable_search:true,
Here is the document for chosen jquery plugin