You are here

function form_get_error in Drupal 6

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

Return the error message filed against the form with the specified name.

Related topics

1 call to form_get_error()
_form_set_class in includes/form.inc
Sets a form element's class attribute.

File

includes/form.inc, line 882

Code

function form_get_error($element) {
  $form = form_set_error();
  $key = $element['#parents'][0];
  if (isset($form[$key])) {
    return $form[$key];
  }
  $key = implode('][', $element['#parents']);
  if (isset($form[$key])) {
    return $form[$key];
  }
}