Versions
5 – 7
form_error(&$element, $message = '')

Flag an element as having an error.

Related topics

▾ 56 functions call form_error()

in contrib-7/ctools/plugins/content_types/node/node.inc
Validate the node selection.
ctools_context_node_edit_form_settings_form_validate in contrib-7/ctools/plugins/contexts/node_edit_form.inc
Validate a node.
ctools_context_node_settings_form_validate in contrib-7/ctools/plugins/contexts/node.inc
Validate a node.
ctools_context_term_settings_form_validate in contrib-7/ctools/plugins/contexts/term.inc
Validate a term.
ctools_context_user_settings_form_validate in contrib-7/ctools/plugins/contexts/user.inc
Validate a user.
ctools_custom_content_type_edit_form_validate in contrib-7/ctools/plugins/content_types/custom/custom.inc
The validate form to ensure the custom content data is okay.
date_field_widget_error in contrib-7/date/date/date.module
Implements hook_field_widget_error().
date_text_validate in contrib-7/date/date_api_elements.inc
Validation for text input.
date_validate in drupal-7/includes/form.inc
Validates the date type to stop dates like February 30, 2006.
domain_alias_form_validate in contrib-7/domain/domain_alias/domain_alias.admin.inc
FAPI for domain_alias_form()
field_default_form_errors in drupal-7/modules/field/field.form.inc
Transfer field-level validation errors to widgets.
field_example_3text_validate in contrib-7/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 contrib-7/examples/field_example/field_example.module
Implements hook_field_widget_error().
field_test_field_widget_error in drupal-7/modules/field/tests/field_test.field.inc
Implements hook_field_widget_error().
file_managed_file_validate in drupal-7/modules/file/file.module
An #element_validate callback for the managed_file element.
form_test_limit_validation_errors_element_validate_test in drupal-7/modules/simpletest/tests/form_test.module
Form element validation handler for the 'test' element.
hook_field_widget_error in drupal-7/modules/field/field.api.php
Flag a field-level validation error.
image_effect_color_validate in drupal-7/modules/image/image.admin.inc
Element validate handler to ensure a hexadecimal color value.
image_effect_integer_validate in drupal-7/modules/image/image.admin.inc
Element validate handler to ensure an integer pixel value.
image_effect_scale_validate in drupal-7/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 drupal-7/modules/image/image.admin.inc
Validate handler for adding a new image effect to an image style.
install_configure_form_validate in drupal-7/includes/install.core.inc
Forms API validate for the site configuration form.
list_allowed_values_setting_validate in drupal-7/modules/field/modules/list/list.module
Element validate callback; check that the entered values are valid.
mollom_admin_configure_form_validate in contrib-7/mollom/mollom.admin.inc
Form validation handler for mollom_admin_configure_form().
node_reference_autocomplete_validate in contrib-7/cck/modules/node_reference/node_reference.module
Validation callback for a node_reference autocomplete element.
node_reference_field_widget_error in contrib-7/cck/modules/node_reference/node_reference.module
Implements hook_field_widget_error().
number_field_widget_error in drupal-7/modules/field/modules/number/number.module
Implements hook_field_widget_error().
number_field_widget_validate in drupal-7/modules/field/modules/number/number.module
FAPI validation of an individual number element.
options_field_widget_error in drupal-7/modules/field/modules/options/options.module
Implements hook_field_widget_error().
options_field_widget_validate in drupal-7/modules/field/modules/options/options.module
Form element validation handler for options element.
page_manager_handler_import_validate in contrib-7/ctools/page_manager/page_manager.admin.inc
Make sure that an import actually provides a handler.
page_manager_page_form_basic_validate in contrib-7/ctools/page_manager/plugins/tasks/page.admin.inc
Validate the basic form.
page_manager_page_form_menu_validate in contrib-7/ctools/page_manager/plugins/tasks/page.admin.inc
Validate handler for the menu form for add/edit page task.
page_manager_page_import_subtask_validate in contrib-7/ctools/page_manager/plugins/tasks/page.admin.inc
Ensure we got a valid page.
password_confirm_validate in drupal-7/includes/form.inc
Validate password_confirm element.
rules_ui_element_date_validate in contrib-7/rules/rules/ui/ui.forms.inc
FAPI validation of a date element. Makes sure the specified date format is correct and converts date values specifiy a fixed (= non relative) date to a timestamp. Relative dates are handled by the date input evaluator.
rules_ui_element_decimal_validate in contrib-7/rules/rules/ui/ui.forms.inc
FAPI validation of a decimal element. Improved version of the private function _element_validate_number().
rules_ui_element_integer_list_validate in contrib-7/rules/rules/ui/ui.forms.inc
FAPI callback to validate a list of integers.
rules_ui_element_integer_validate in contrib-7/rules/rules/ui/ui.forms.inc
FAPI validation of an integer element. Copy of the private function _element_validate_integer().
rules_ui_element_machine_name_validate in contrib-7/rules/rules/ui/ui.forms.inc
FAPI callback to validate a machine readable name.
rules_ui_element_variable_form_validate in contrib-7/rules/rules/ui/ui.forms.inc
FAPI callback to validate the form for editing variable info. See also RulesPluginUI::getVariableForm()
taxonomy_field_widget_error in drupal-7/modules/taxonomy/taxonomy.module
Implements hook_field_widget_error().
text_field_widget_error in drupal-7/modules/field/modules/text/text.module
Implements hook_field_widget_error().
user_reference_autocomplete_validate in contrib-7/cck/modules/user_reference/user_reference.module
Validation callback for a user_reference autocomplete element.
user_reference_field_widget_error in contrib-7/cck/modules/user_reference/user_reference.module
Implements hook_field_widget_error().
views_ui_add_form_validate in contrib-7/views/includes/admin.inc
Validate the add view form.
views_ui_change_style_form_validate in contrib-7/views/includes/admin.inc
views_ui_import_validate in contrib-7/views/includes/admin.inc
Validate handler to import a view
_domain_alias_validate in contrib-7/domain/domain_alias/domain_alias.admin.inc
Helper function to validate alias entries.
_element_validate_integer in drupal-7/modules/field_ui/field_ui.admin.inc
Helper form element validator: integer.
_element_validate_integer_positive in drupal-7/modules/field_ui/field_ui.admin.inc
Helper form element validator: integer > 0.
_element_validate_number in drupal-7/modules/field_ui/field_ui.admin.inc
Helper form element validator: number.
_file_generic_settings_extensions in drupal-7/modules/file/file.field.inc
Element validate callback for the allowed file extensions field.
_file_generic_settings_max_filesize in drupal-7/modules/file/file.field.inc
Element validate callback for the maximum upload size field.
_form_validate in drupal-7/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 drupal-7/modules/image/image.field.inc
Element validate function for resolution fields.

Code

drupal-7/includes/form.inc, line 1435

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

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options