function hook_field_widget_error

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 field.api.php hook_field_widget_error($element, $error, $form, &$form_state)
cle7 field.api.php hook_field_widget_error($element, $error, $form, &$form_state)
elmsmedia7 field.api.php hook_field_widget_error($element, $error, $form, &$form_state)
icor7 field.api.php hook_field_widget_error($element, $error, $form, &$form_state)
meedjum_blog7 field.api.php hook_field_widget_error($element, $error, $form, &$form_state)
mooc7 field.api.php hook_field_widget_error($element, $error, $form, &$form_state)

Flag a field-level validation error.

Parameters

$element: An array containing the form element for the widget. The error needs to be flagged on the right sub-element, according to the widget's internal structure.

$error: An associative array with the following key-value pairs, as returned by hook_field_validate():

  • error: the error code. Complex widgets might need to report different errors to different form elements inside the widget.
  • message: the human readable message to be displayed.

$form: The form structure where field elements are attached to. This might be a full form structure, or a sub-element of a larger form.

$form_state: An associative array containing the current state of the form.

Related topics

12 functions implement hook_field_widget_error()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

date_field_widget_error in sites/all/modules/ulmus/date/date.module
Implements hook_field_widget_error().
email_field_widget_error in sites/all/modules/ulmus/email/email.module
Implements hook_field_widget_error().
entityreference_field_widget_error in sites/all/modules/ulmus/entityreference/entityreference.module
Implements hook_field_widget_error().
field_hidden_field_widget_error in sites/all/modules/ulmus/field_hidden/field_hidden.module
Implements hook_field_widget_error().
field_test_field_widget_error in modules/field/tests/field_test.field.inc
Implements hook_field_widget_error().

... See full list

File

modules/field/field.api.php, line 1004

Code

function hook_field_widget_error($element, $error, $form, &$form_state) {
  form_error($element, $error['message']);
}