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: + +@sp 1 +@itemize +@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. +@item @code{VALIDATE-SIZE} +@item @code{VALIDATE-RANGE} +@item @code{VALIDATE-NUMBER} +@item @code{VALIDATE-INTEGER} +@item @code{VALIDATE-DATE-RANGE} +@end itemize