You are here

function hook_select_or_other_process_alter in Select (or other) 7.3

Implements hook_select_or_other_process_alter().

Provide a hook to alter the widget depending on the context and form_state. In this example we remove the attached files and remove the 'other' textfield depending on the state of the form submitted.

1 invocation of hook_select_or_other_process_alter()
select_or_other_element_process in ./select_or_other.module
Process callback for a Select (or other) element.

File

./select_or_other.api.php, line 35
API documentation for Select or other.

Code

function hook_select_or_other_process_alter(&$element, &$form_state, $context) {
  unset($element['#attached']);
  if ($form_state['submitted']) {
    $element['other']['#access'] = FALSE;
  }
}