The action code is set up so that the
init quotation can validate query parameters, and the
validate quotation can validate POST parameters.
A word to validate parameters and make them available as HTML form values (see
HTML form values ); typically this word is invoked from the
init and
validate quotations:
validate-params ( validators -- )
The above word expects an association list mapping parameter names to validator quotations; validator quotations can use the words in the Custom validation logic can invoke a word when validation fails;
validate-params invokes this word for you:
validation-failed ( -- * )
If validation fails, no more action code is executed, and the client is redirected back to the originating page, where validation errors can be displayed. Note that validation errors are rendered automatically by the
HTML components words, and in particular,
Chloe templates use these words.