function form_error

Flags an element as having an error.

Related topics

47 calls to form_error()
DataFieldRow::validateAliasName in drupal/core/modules/rest/lib/Drupal/rest/Plugin/views/row/DataFieldRow.php
Form element validation handler for \Drupal\rest\Plugin\views\row\DataFieldRow::buildOptionsForm().
Date::buildGroupValidate in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/Date.php
Validate the build group options form.
Date::validateValidTime in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/Date.php
Validate that the time values convert to something usable.
datetime_datelist_validate in drupal/core/modules/datetime/datetime.module
Validation callback for a datelist element.
datetime_datetime_validate in drupal/core/modules/datetime/datetime.module
Validation callback for a datetime element.

... See full list

File

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

Code

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