Same name and namespace in other branches
  1. 4.6.x includes/common.inc \form_get_errors()
  2. 4.7.x includes/form.inc \form_get_errors()
  3. 5.x includes/form.inc \form_get_errors()
  4. 6.x includes/form.inc \form_get_errors()

Returns an associative array of all errors if any.

Return value

array|null The form errors if any, NULL otherwise.

Related topics

10 calls to form_get_errors()
comment_preview in modules/comment/comment.module
Generate a comment preview.
drupal_process_form in includes/form.inc
Processes a form submission.
FormsElementsTableSelectFunctionalTest::formSubmitHelper in modules/simpletest/tests/form.test
Helper function for the option check test to submit a form while collecting errors.
FormsProgrammaticTestCase::submitForm in modules/simpletest/tests/form.test
Helper function used to programmatically submit the form defined in form_test.module with the given values.
FormsTestCase::testRequiredFields in modules/simpletest/tests/form.test
Check several empty values for required forms elements.

... See full list

File

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

Code

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