Chosen uses the Chosen jQuery plugin to make your
<select> elements more user-friendly.
- Download the Chosen jQuery plugin and extract the file under sites/all/libraries (The Drupal 8 version uses version 1.5 or higher).
- Download and enable the module.
- Configure at Administer > Configuration > User interface > Chosen (requires administer site configuration permission)
By default the module will automatically apply itself to any select elements that have more than 20 options, which is a reasonable default for which having Chosen will be useful. To change or disable this automatic enhancement, you can change the selectors (or remove all selectors) from the Apply Chosen to the following elements field on the Chosen administration page.
FAPI #chosen property
For developers, you can force the Chosen library to be applied or never applied to your select FAPI element by adding
$element['#chosen'] = TRUE; or
$element['#chosen'] = FALSE; respectively.
You can force enable/disable Chosen for certain field widgets: Select list (for both list and date fields), and Select (or other) list. If you have a field using one of these widgets, in the field settings, you will find a Apply Chosen to the select fields in this widget? option with three values: Apply, Do not apply, or No preference (which will fall back to using the automatic application).
Installation via Drush
A Drush command is provided in the latest versions for easy installation of the Chosen plugin.
The command will download the plugin and unpack it in "sites/all/libraries".
It is possible to add another path as an option to the command, but not
recommended unless you know what you are doing.
For the Drupal 8 version, if you are using Composer to manage your site's dependencies, then the Chosen plugin will automatically be downloaded to `libraries/chosen`.
The 7.x-2.0-alpha2 and 7.x-2.0-alpha4 releases added a dependency on the jQuery Update module. As of 7.x-2.0-beta1 this dependency has been removed.
The Drupal 8 version has no dependencies.
- Maintenance status: Actively maintained
- Development status: Under active development
- Reported installs: 39,423 sites currently report using this module. View usage statistics.
- Downloads: 237,627
- Automated tests: Enabled
- Last modified: March 31, 2016
- Stable releases receive coverage from the Drupal Security Team.
Look for the shield icon below.