1 options.module options_field_widget_validate($element, &$form_state)

Form element validation handler for options element.

File

core/modules/field/modules/options/options.module, line 182
Defines selection, check box and radio button widgets for text and numeric fields.

Code

function options_field_widget_validate($element, &$form_state) {
  if ($element['#required'] && $element['#value'] == '_none') {
    form_error($element, t('!name field is required.', array('!name' => $element['#title'])));
  }
  // Transpose selections from field => delta to delta => field, turning
  // multiple selected options into multiple parent elements.
  $items = _options_form_to_storage($element);
  form_set_value($element, $items, $form_state);
}