by Jeff Eaton on April 16, 2012 // Short URL

Module Monday: Multiple Selects

How to Easily Select Multiple Form Elements in Drupal 7 -- No More control-alt-click!

Oh, scrolling multi-select form elements. Does anyone really like them? Picking multiple items from one of these widgets often requires option-control-alt-clicking your way through a long list, hoping you don't accidentally deselect the options you've carefully chosen. Drupal's default Select Widget allows you to use convenient dropdown select menus to choose the contents of single-value fields, but if you have a multi-value field, you're out of luck. Wouldn't it be great to give content editors a list of several single-select dropdowns, rather than the unruly multi-select box? It would, and that's precisely what the Multi Selects module does.

Screenshot of Multiple Selects being added

Like many cool Drupal 7 tricks, Multiple Selects is a field editing widget that can be used with multi-value list fields like Text and number lists, as well as taxonomy term references. No configuration is necessary -- just set the field's widget to "Multiple Selects," and you're ready to go. Rather than a single scrolling multi-select box, content editors will see single-select dropdowns, with the traditional FieldAPI 'Add another item' button below.

Screenshot of Multiple Selects in action

In addition to providing a slightly cleaner editing interface, this approach allows editors to choose the order in which their field values appear. Adding five taxonomy terms and then dragging them into the correct order is impossible with a multi-select box, but works fine once Multiple Selects is enabled. The only downside is that it doesn't support node, user, or entity reference fields yet. That addition is a minor change, though, and a patch to add it has already been posted. If you're looking for a simple multi-value select widget that also gives your editors control over the order of the values entered, look no farther than the Multiple Selects module.