You are here

function itoggle_field_field_widget_validate in iToggle 7.2

Form element validation handler for iToggle element.

See also

itoggle_field_field_widget_form()

1 string reference to 'itoggle_field_field_widget_validate'
itoggle_field_field_widget_form in modules/field/itoggle_field.module
Implements hook_field_widget_form().

File

modules/field/itoggle_field.module, line 200
iToggle Field module.

Code

function itoggle_field_field_widget_validate($element, &$form_state) {
  if ($element['#required'] && $element['#value'] == '_none') {
    form_error($element, t('!name field is required.', array(
      '!name' => $element['#title'],
    )));
  }
  $items = array(
    array(
      'value' => $element['#value'],
    ),
  );
  form_set_value($element, $items, $form_state);
}