form_set_error

Versions
4.6
form_set_error($name, $message)
4.7 – 5
form_set_error($name = NULL, $message = '')
6
form_set_error($name = NULL, $message = '', $reset = FALSE)
7
form_set_error($name = NULL, $message = '')

File an error against the form element with the specified name.

Related topics

▾ 28 functions call form_set_error()

comment_validate_form in modules/comment.module
contact_mail_user in modules/contact.module
drupal_settings in modules/drupal.module
Implementation of hook_settings().
file_check_directory in includes/file.inc
Check that directory exists and is writable.
forum_validate in modules/forum.module
Implementation of hook_validate().
hook_validate in developer/hooks/node.php
Verify a node editing form.
image_gd_settings in includes/image.inc
Retrieve settings for the GD2 toolkit (not used).
menu_edit_item_validate in modules/menu.module
Confirm that an edited menu item has fields properly filled in.
nodeapi_example_nodeapi in developer/examples/nodeapi_example.module
Implementation of hook_nodeapi().
node_admin_nodes in modules/node.module
Generate the content administration overview.
node_example_validate in developer/examples/node_example.module
Implementation of hook_validate().
node_validate in modules/node.module
Perform validation checks on the given node.
path_nodeapi in modules/path.module
Implementation of hook_nodeapi().
path_save in modules/path.module
Verify that a new URL alias is valid, and save it to the database.
poll_validate in modules/poll.module
Implementation of hook_validate().
profile_admin_add in modules/profile.module
Menu callback; adds a new field to all user profiles.
profile_validate_form in modules/profile.module
profile_validate_profile in modules/profile.module
search_view in modules/search.module
Menu callback; presents the search form and/or search results.
system_theme_settings in modules/system.module
Menu callback; display theme configuration for entire site and individual themes.
upload_nodeapi in modules/upload.module
Implementation of hook_nodeapi().
user_admin_access_add in modules/user.module
Menu callback: add an access rule
user_admin_access_edit in modules/user.module
Menu callback: edit an access rule
user_admin_role in modules/user.module
Menu callback: administer roles.
user_edit_validate in modules/user.module
user_pass in modules/user.module
user_validate_picture in modules/user.module
_throttle_validate in modules/throttle.module

Code

includes/common.inc, line 1009

<?php
function form_set_error($name, $message) {
  $GLOBALS['form'][$name] = $message;
  drupal_set_message($message, 'error');
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.