Module Monday: Chosen

Creating Shorter and More User-Friendly Select Boxes in Drupal 7 (For Those who Hate Auto Complete)

For a long time now, Drupal has been using the idea of the "auto-complete" for such things as taxonomy tags, node references, and user references. While convenient in the fact that it's ajaxified and will display relevant options as you begin to type, it's long been a bit of a problem for users who really have no pre-conceived notion of how typical auto-complete form controls work, or for those with slower connections who end up waiting while they stare at a little spinning icon for their results to be returned to them. Select boxes are a universally recognized form control, and also a valid alternative to each of the field types I described above which typically utilize the auto-complete widget within Drupal. However, for many use cases, the typical select box widget can have a ton of results and become a very long list of options to scroll down through and chose from. The auto-complete widget was originally created in an attempt to mitigate this UX problem. But I submit to you an attractive alternative to the typical solution this problem: Chosen. Chosen is a javascript library built by the incredible people who brought you the time tracking software, Harvest. The library is an open-source project on Github and simply seeks to "... [make] long, unwieldy select boxes more user friendly."

We've decided to use this on the new Drupalcon Denver website for choosing the speakers when submitting a session.

The module itself is little more than a configuration screen that allows you to choose the minimum number of options to show when the cursor is first placed within the select box's text field, and what elements to target.

Chosen is currently only available for Drupal 7.x-1.0 (though I'm sure would be a fairly simply backport to 6.x), and it's currently in use on over 50 sites. It has a dependency on the ever-useful Libraries module and is maintained by Arshad Chummun. If you find this as intriguing a UX change as I do to the typical auto-complete widget, check it out!

Get in touch with us

Tell us about your project or drop us a line. We'd love to hear from you!