function form_set_error in Drupal 4
Same name and namespace in other branches
- 5 includes/form.inc \form_set_error()
- 6 includes/form.inc \form_set_error()
- 7 includes/form.inc \form_set_error()
File an error against a form element. If the name of the element is edit[foo][bar] then you may pass either foo or foo][bar as $name foo will set an error for all its children.
Related topics
44 calls to form_set_error()
- aggregator_form_category_validate in modules/
aggregator.module - Validate aggregator_form_feed form submissions.
- aggregator_form_feed_validate in modules/
aggregator.module - Validate aggregator_form_feed form submissions.
- block_admin_configure_validate in modules/
block.module - block_box_add_validate in modules/
block.module - comment_admin_overview_validate in modules/
comment.module - We can't execute any 'Update options' if no comments were selected.
File
- includes/
form.inc, line 282
Code
function form_set_error($name = NULL, $message = '') {
static $form = array();
if (isset($name) && !isset($form[$name])) {
$form[$name] = $message;
if ($message) {
drupal_set_message($message, 'error');
}
}
return $form;
}