1 form.inc form_get_errors()

Returns an associative array of all errors.

Return value

array|NULL: An array of any errors that have been set. NULL if no errors occurred.

Related topics

File

core/includes/form.inc, line 1717
Functions for form and batch generation and processing.

Code

function form_get_errors() {
  $errors = form_set_error();
  if (!empty($errors)) {
    return $errors;
  }
  return NULL;
}