4.7.x form.inc form_error(&$element, $message = '')
5.x form.inc form_error(&$element, $message = '')
6.x form.inc form_error(&$element, $message = '')
7.x form.inc form_error(&$element, $message = '')

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);
}