form_error

  1. drupal
    1. 5
    2. 6
    3. 7
    4. 8
Versions
5 – 8 form_error(&$element, $message = '')

Flag an element as having an error.

Related topics

▾ 31 functions call form_error()

date_validate in includes/form.inc
Validates the date type to stop dates like February 30, 2006.
element_validate_integer in includes/form.inc
Helper form element validator: integer.
element_validate_integer_positive in includes/form.inc
Helper form element validator: integer > 0.
element_validate_number in includes/form.inc
Helper form element validator: number.
field_default_form_errors in modules/field/field.form.inc
Transfer field-level validation errors to widgets.
field_example_3text_validate in examples/field_example/field_example.module
Validate the individual fields and then convert them into a single HTML RGB value as text.
field_example_field_widget_error in examples/field_example/field_example.module
Implements hook_field_widget_error().
field_test_field_widget_error in modules/field/tests/field_test.field.inc
Implements hook_field_widget_error().
file_managed_file_validate in modules/file/file.module
An #element_validate callback for the managed_file element.
form_example_phonenumber_combined_validate in examples/form_example/form_example_elements.inc
Phone number validation function for the combined phonenumber.
form_example_phonenumber_discrete_validate in examples/form_example/form_example_elements.inc
Validation handler for the discrete version of the phone number.
form_test_limit_validation_errors_element_validate_test in modules/simpletest/tests/form_test.module
Form element validation handler for the 'test' element.
form_validate_machine_name in includes/form.inc
Form element validation handler for #type 'machine_name'.
hook_field_widget_error in modules/field/field.api.php
Flag a field-level validation error.
image_effect_color_validate in modules/image/image.admin.inc
Element validate handler to ensure a hexadecimal color value.
image_effect_integer_validate in modules/image/image.admin.inc
Element validate handler to ensure an integer pixel value.
image_effect_scale_validate in modules/image/image.admin.inc
Element validate handler to ensure that either a height or a width is specified.
image_style_form_add_validate in modules/image/image.admin.inc
Validate handler for adding a new image effect to an image style.
install_configure_form_validate in includes/install.core.inc
Forms API validate for the site configuration form.
list_allowed_values_setting_validate in modules/field/modules/list/list.module
Element validate callback; check that the entered values are valid.
number_field_widget_error in modules/field/modules/number/number.module
Implements hook_field_widget_error().
number_field_widget_validate in modules/field/modules/number/number.module
FAPI validation of an individual number element.
options_field_widget_error in modules/field/modules/options/options.module
Implements hook_field_widget_error().
options_field_widget_validate in modules/field/modules/options/options.module
Form element validation handler for options element.
password_confirm_validate in includes/form.inc
Validate password_confirm element.
taxonomy_field_widget_error in modules/taxonomy/taxonomy.module
Implements hook_field_widget_error().
text_field_widget_error in modules/field/modules/text/text.module
Implements hook_field_widget_error().
_file_generic_settings_extensions in modules/file/file.field.inc
Element validate callback for the allowed file extensions field.
_file_generic_settings_max_filesize in modules/file/file.field.inc
Element validate callback for the maximum upload size field.
_form_validate in includes/form.inc
Performs validation on form elements. First ensures required fields are completed, #maxlength is not exceeded, and selected options were in the list of options given to the user. Then calls user-defined validators.
_image_field_resolution_validate in modules/image/image.field.inc
Element validate function for resolution fields.

Code

includes/form.inc, line 1613

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