You are here

function phonefield_field_widget_error in Phone Field 7

Implements hook_field_widget_error().

File

./phonefield.module, line 228
Hooks for a module that defines a simple phone number field type.

Code

function phonefield_field_widget_error($element, $error, $form, &$form_state) {
  if (!empty($error['error_element']['linklabel'])) {
    form_error($element['linklabel'], $error['message']);
  }
  elseif (!empty($error['error_element']['phonenumber'])) {
    form_error($element['phonenumber'], $error['message']);
  }
}