Radios Select
Component ID
1399438
Component name
Radios Select
Component type
module
Maintenance status
Development status
Component security advisory coverage
not-covered
Downloads
765
Component created
Component changed
Component body
Radios Select is the helper utility which provides new custom look of the
ordinary radios form element via jQuery/CSS (when you create this element from
your own module). The main feature of Radios Select is ability to format output of radios field like "select" form element or dropdown menu. Once Radios Select module enabled you can create Radios Select form element by just adding new property "#radios_select" to any standard radios element:
$form['radios_select'] = array(
'#type' => 'radios', // yes, ordinary radios element
'#title' => t('Select value:'),
'#default_value' => 1,
'#options' => $values,
'#radios_select' => TRUE, // enables Radios Select for this radios element
'#description' => t('Value to use in form.'),
);
Radios Select also have a lot of own attributes ("#rs_attributes" property) which allows you to customize look of the element.
$form['radios_select'] = array(
'#type' => 'radios', // yes, ordinary radios element
'#title' => t('Select word:'),
'#default_value' => 2,
'#options' => $values,
'#radios_select' => TRUE, // enables Radios Select for this radios element
'#rs_attributes' => array(
'label' => array(
'font' => 'Times New Roman', // this sets font family (same as in CSS way)
'font_size' => 1.4, // this sets font size (in "units" units)
'font_color' => '#339933', // this sets font color (same as in CSS way)
'line_height' => 2, // this sets line height (in "units" units)
'units' => 'em', // can be em or px (default: px)
),
),
'#description' => t('Word to use in form.'),
);
More information about all Radios Select attributes with examples of usage available on the module's help page (admin/help/radios_select).
