form_error

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

Flag an element as having an error.

Related topics

▾ 5 functions call form_error()

aggregator_page_list_validate in modules/aggregator.module
date_validate in includes/form.inc
Validates the FAPI date type to stop dates like 30/Feb/2006
filter_form_validate in modules/filter.module
password_confirm_validate in includes/form.inc
Validate password_confirm element.
_form_validate in includes/form.inc

Code

includes/form.inc, line 321

<?php
function form_error(&$element, $message = '') {
  $element['#error'] = TRUE;
  form_set_error(implode('][', $element['#parents']), $message);
}
?>
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.