form_get_error

Versions
4.7 – 7
form_get_error($element)

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

Related topics

▾ 12 functions call form_get_error()

theme_checkbox in includes/form.inc
Format a checkbox.
theme_checkboxes in includes/form.inc
Format a set of checkboxes.
theme_date in includes/form.inc
Format a date selection element.
theme_file in includes/form.inc
Format a file upload field.
theme_password in includes/form.inc
Format a password field. * *
theme_password_confirm in includes/form.inc
Format a password_confirm item.
theme_radio in includes/form.inc
Format a radio button.
theme_radios in includes/form.inc
Format a set of radio buttons.
theme_select in includes/form.inc
Format a dropdown menu or scrolling selection box.
theme_textarea in includes/form.inc
Format a textarea.
theme_textfield in includes/form.inc
Format a textfield.
_form_set_class in includes/form.inc
Sets a form element's class attribute.

Code

includes/form.inc, line 306

<?php
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];
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.