You are here

function form_error in Drupal 5

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

Flag an element as having an error.

Related topics

5 calls to form_error()
aggregator_page_list_validate in modules/aggregator/aggregator.module
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
password_confirm_validate in includes/form.inc
Validate password_confirm element.
_form_validate in includes/form.inc
Performs validation on form elements. First ensures required fields are completed, #maxlength is not exceeded, and selected options were in the list of options given to the user. Then calls user-defined validators.

File

includes/form.inc, line 631

Code

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