From 7f08110a5e29c29812a01b9c148e52b34f3eccdf Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 31 May 2004 09:40:56 +0000 Subject: - Improved form handling. + Introduced two new functions: 1. form_set_error($name, $message): files an error against the form element with the specified $name. 2. form_has_errors(): returns true if errors has been filed against form elements. + Updated the form handling: 1. The form_ functions will add 'class="error"' when a form field has been found to be erroneous. 2. The error message is passed to theme_form_element() when the particular form field has been found to be erroneous. + I updated the user and profile module to take advantage of these new functions. + IMPORTANT: the _user() hook changed. The 'validate' case should no longer retun an error message when something goes wrong but should set it with form_set_error(). --- misc/drupal.css | 3 +++ 1 file changed, 3 insertions(+) (limited to 'misc') diff --git a/misc/drupal.css b/misc/drupal.css index 67eae6dee..9a51f7527 100644 --- a/misc/drupal.css +++ b/misc/drupal.css @@ -132,6 +132,9 @@ td.menu-disabled { .form-item { margin-bottom: 1em; } +.form-item input.error { + border: 2px solid red; +} .form-item .description { font-size: 0.85em; } -- cgit v1.2.3