function form_error

Flags an element as having an error.

Related topics

16 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.
form_test_limit_validation_errors_element_validate_test in modules/simpletest/tests/form_test.module
Form element validation handler for the 'test' element.

... 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.