You are here

function fel_select_or_other_element_process in Form element layout 7

Additional processing for element type 'select_or_other'.

1 string reference to 'fel_select_or_other_element_process'
fel_element_info_alter in ./fel.module
Implements hook_element_info_alter().

File

./fel.module, line 392
Reorder #title, #description and #children in forms.

Code

function fel_select_or_other_element_process($element, &$form_state) {

  // If the description is set to be before the input element, we have to move
  // it from the outside container to the nested select/radios/checkboxes input
  // element and apply the FAPI attributes there.
  if (!empty($element['#description']) && !empty($element['#description_display']) && $element['#description_display'] === 'before') {
    $element['select']['#description'] = $element['#description'];
    $element['select']['#description_display'] = $element['#description_display'];
    unset($element['#description']);
  }
  return $element;
}