You are here

function form_error in Drupal 7

Same name and namespace in other branches
  1. 4 includes/form.inc \form_error()
  2. 5 includes/form.inc \form_error()
  3. 6 includes/form.inc \form_error()

Flags an element as having an error.

Related topics

28 calls to form_error()
date_validate in includes/form.inc
Validates the date type to prevent invalid dates (e.g., February 30, 2006).
element_validate_integer in includes/form.inc
Form element validation handler for integer elements.
element_validate_integer_positive in includes/form.inc
Form element validation handler for integer elements that must be positive.
element_validate_number in includes/form.inc
Form element validation handler for number elements.
field_default_form_errors in modules/field/field.form.inc
Transfer field-level validation errors to widgets.

... See full list

File

includes/form.inc, line 1712
Functions for form and batch generation and processing.

Code

function form_error(&$element, $message = '') {
  form_set_error(implode('][', $element['#parents']), $message);
}