function text_field_widget_error

7.x text.module text_field_widget_error($element, $error, $form, &$form_state)

Implements hook_field_widget_error().

File

drupal/modules/field/modules/text/text.module, line 567
Defines simple text field types.

Code

function text_field_widget_error($element, $error, $form, &$form_state) {
  switch ($error['error']) {
    case 'text_summary_max_length':
      $error_element = $element[$element['#columns'][1]];
      break;

    default:
      $error_element = $element[$element['#columns'][0]];
      break;
  }

  form_error($error_element, $error['message']);
}