function 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 1718

Code

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

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