Questions tagged [jquery-chosen]

Chosen is a JavaScript plugin that makes long, unwieldy select boxes much more user-friendly. It is currently available in both jQuery and Prototype flavors.

It can be tough to style <select> dropdowns with just css. Chosen is a JavaScript plugin that allows you to style dropdowns differently, and make long, unwieldy select boxes much more user-friendly. It is currently available in both jQuery and Prototype flavors.

Stack Overflow Starter Kit

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.jquery.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.css" />

<select class='chosen-select'>
  <option>Option 1</option>
  <option>Option 2</option>
</select>

JS

$(".chosen-select").chosen({
  // Options //
  // disable_search_threshold
  // no_results_text
  // max_selected_options
  // rtl
  // width
});

Resource

Related tags

1304 questions
157
votes
11 answers

What are the differences between Chosen and Select2?

Chosen and Select2 are the two more popular libraries for extending selectboxes. Both seem to be actively maintained, Chosen is older and supports both jQuery and Prototype. Select2 is jQuery only, its documentation says Select2 is inspired by…
Boycott Russia
  • 11,818
  • 5
  • 28
  • 29
119
votes
4 answers

Changing selection in a select with the Chosen plugin

I'm trying to change the currently selected option in a select with the Chosen plugin. The documentation covers updating the list, and triggering an event when an option is selected, but nothing (that I can see) on externally changing the currently…
gak
  • 32,061
  • 28
  • 119
  • 154
96
votes
7 answers

disable jquery-chosen dropdown

I have a select div that I'm using the chosen jquery plugin to style and add features to (most notably, search). The div looks something like this,
P H
  • 963
  • 1
  • 7
  • 8
81
votes
18 answers

How can I use jQuery validation with the "chosen" plugin?

I have some
plexcell
  • 1,647
  • 2
  • 15
  • 29
80
votes
22 answers

How do I reset a jquery-chosen select option with jQuery?

I have tried numerous things and nothing seems to be working. I am using jQuery and Chosen plugin. Methods I have tried: var select = jQuery('#autoship_option'); select.val(jQuery('options:first',…
James Wilson
  • 5,074
  • 16
  • 63
  • 122
65
votes
9 answers

Chosen Jquery Plugin - getting selected values

How can i get the selected values from the chosen Multi-select Box?
Aakash Shah
  • 669
  • 1
  • 5
  • 12
61
votes
5 answers

jQuery Chosen plugin add options dynamically

I make a jQuery Chosen drop-down like this: $('.blah').chosen(); I can't find how I can add options, something like: $('.blah').chosen('add', name, value);
SBel
  • 3,315
  • 6
  • 29
  • 47
51
votes
10 answers

allow new values with chosen.js multiple select

I'm using the chosen.js plugin http://harvesthq.github.com/chosen/ with jQuery to allow the user to select multiple options from a select. However, I now want to be able to let them create values that aren't already present - any idea how to go…
totallyNotLizards
  • 8,489
  • 9
  • 51
  • 85
41
votes
12 answers

Jquery Chosen plugin - dynamically populate list by Ajax

Im trying to build my dropdown menu using the plugin Chosen for Multiple Select . Here's to behavior I'm based on: http://jsfiddle.net/JfLvA/ So, instead of having 3 harcoded < option > in my select. I want this list to be the values of a json array…
Lelly
  • 960
  • 3
  • 15
  • 29
39
votes
6 answers

Chosen plugin doesn't seem to work on mobile browsers

I have set up a Chosen plugin for a select field for the user to be able to type-search from a long list. Although I am developing this for mobile phones and while it works fine on computer, it is disabled on both Apple and Android phones and the…
Boldizsar
  • 683
  • 2
  • 8
  • 17
34
votes
6 answers

chosen with bootstrap 3 not working properly

I have this code which triggers a bootstrap modal and load its content via $.load(). the page I'm loading has a select element which I'm calling chosen on. Here's the code: $('.someClick').click(function(e){ e.preventDefault(); …
mamdouh alramadan
  • 8,349
  • 6
  • 36
  • 53
33
votes
8 answers

Chosen updated not working

I have a chosen dropdown. I changed options content and call trigger chosen:updated but Chosen don't rebuild the dropdown. This is my updated