FAPI Selector Element: jQuery Sortable Selector
This is an extension module for Drupal Forms API that provides jQueryUI linked sortable element as a Forms API element. This element is a multi-selectbox "killer". You would probably want to use it instead of select-box with "#multiple", in many cases, because:
- It looks so much cooler.
- This element provides sorting capabilities that select-box does not.
This is how you would use the new element in your form code:
$form['country_selector'] = array(
'#title' => t('Select Countries'),
'#type' => 'jquery_selector',
'#description' => t('Some description here'),
'#options' => array(
'#enabled' => array('one'=>'one', 'two'=>'two', 'three'=>'three'),
'#disabled' => array('four'=>'four', 'five'=>'five', 'six'=>'six'),
'#default_value' => array('one'=>'one', 'two'=>'two', 'three'=>'three', 'four'=>'four', 'five'=>'five', 'six'=>'six'),
#default_value is used when #options itself or both #enabled and #disabled arrays, in it, are empty. In such case, #disabled array is filled with #default_value and #enabled is set to empty array (Starting position).
Please make sure that the '#enabled' and '#disabled' arrays are associative arrays with distinct keys! If this condition is not met, proper functioning of the form element can not be guaranteed.
Similar widget for CCK: MultiSelect.
- Maintenance status: Unknown
- Development status: Unknown
- Reported installs: 8 sites currently report using this module. View usage statistics.
- Downloads: 885
- Last modified: May 11, 2012