[claw-cvs] r167 - trunk/doc/chapters

Andrea Chiumenti achiumenti at common-lisp.net
Tue Dec 23 07:28:41 UTC 2008


Author: achiumenti
Date: Tue Dec 23 07:28:41 2008
New Revision: 167

Log:


Modified:
   trunk/doc/chapters/claw-html.texinfo

Modified: trunk/doc/chapters/claw-html.texinfo
==============================================================================
--- trunk/doc/chapters/claw-html.texinfo	(original)
+++ trunk/doc/chapters/claw-html.texinfo	Tue Dec 23 07:28:41 2008
@@ -516,7 +516,6 @@
                   (div> :class "topHeader" "top header")
                   (div> :class "mainContent"
                         (cform> :action 'index-page-say-hello
-;                                :method "post"
                                 "Write your name "
                                 (cinput> :id "username"
                                          :accessor 'index-page-username)
@@ -537,3 +536,21 @@
 
 There is an easy way to avoid this behaviour, ...validation!
 
+For validation you have to provide the @code{CINPUT} component with the @code{:VALIDATOR} key. This points to a validator function.
+
+A validator function if a function that accepts the @code{value} that is passed by the form component; if the validation fails, a validation
+error message is added to the variable @code{*validation-errors*}. The component @code{EXCEPTION-MONITOR} is given to show these validation errors.
+
+Currently the following validation functions are provided:
+
+ at sp 1
+ at itemize
+ at item @code{VALIDATE-REQUIRED} 
+Checks if the required input field VALUE is present.  If not, a localizable message "Field ~a may not be empty." is sent with key "VALIDATE-REQUIRED".
+The argument for the message will be the @code{:LABEL} attribute of the COMPONENT.
+ at item @code{VALIDATE-SIZE}
+ at item @code{VALIDATE-RANGE}
+ at item @code{VALIDATE-NUMBER}
+ at item @code{VALIDATE-INTEGER}
+ at item @code{VALIDATE-DATE-RANGE}
+ at end itemize




More information about the Claw-cvs mailing list