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

Flag an element as having an error.

Related topics

6 calls to form_error()
aggregator_categorize_items_validate in modules/aggregator/aggregator.pages.inc
Validate aggregator_categorize_items form submissions.
date_validate in includes/form.inc
Validates the date type to stop dates like February 30, 2006.
filter_form_validate in modules/filter/filter.module
Validation callback for filter elements in a form.
install_configure_form_validate in ./install.php
Form API validate for the site configuration form.
password_confirm_validate in includes/form.inc
Validate password_confirm element.

... See full list

File

includes/form.inc, line 897

Code

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