Improved Multi Select

User Interface

Note: A lot of this functionality is only available in the 2.x version.

The Improved Multi Select module replace the default multi-select boxes with two panel list and search. The first panel holds the options that are available, and the second panel holds the options that have been selected. Two panels are separated by "add" and "remove" buttons. You can select an item from the first box, click the "add" button, and add it to the second box. Likewise, you can select an item from the second box, click the "remove" button, and it goes back into the unselected box. Re-Ordering buttons allow users to move items that have been selected up and down.
Improved Multi Select

A search box allows users to quickly filter the left column to find items. Admins can decide how precise users need to be when entering searches. Options include Exact Match, All Words, and Any Words. For each option, admins can decide if they want to allow partial words.
Search

Modify attributes of a form field (EXAMPLE: ADD SIZE attribute of a multi select box to make it bigger)

Goal:

ADD(or or modify) an attribute of a form field.
For this example, we'll be ADDING the "size" attribute to a multi select box in a custom content type, with the intent to make the select box bigger, vertically, so that more options are visible at once.

What you'll need to know:

  1. How to create and enable a custom module (not covered here)
  2. my_form_id (The form ID of the form you want to change, see previous page for details)
  3. my_field_name (The field name of the form field you want to modify, see section below for details)
  4. my_content_type (The content type you're changing the fields for. Don't worry if you're not dealing with a content type form, the below info applies to just about any form you'll likely come across).

The resulting code:

/**
 * Implements hook_form_alter().
 */
function mymodule_form_alter(&$form, $form_state, $form_id) {
  if($form_id == 'my_form_id'){
    $form['my_field_name']['#language']['#size'] = '20';
  }
}

The What, Where, and Why:

if($form_id == 'my_form_id')
This IF statement is important if you you do not want to process every form on your site with this modification.

Subscribe with RSS Subscribe to RSS - multi select fields