You are here

function text_field_widget_error in Drupal 7

Implements hook_field_widget_error().

File

modules/field/modules/text/text.module, line 569
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']);
}