function text_field_widget_error

Implements hook_field_widget_error().

File

modules/field/modules/text/text.module, line 577

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']);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.