root/tags/RELEASE_0_9_0B1/docs/rules.txt

Revision 2, 0.8 kB (checked in by schst, 5 years ago)

initial import on new server

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 Validation Rules:
2 -----------------
3 $Id$
4
5 A validation rule is an object that supplies one method
6 to do a complex validation either for a form element or
7 the complete form.
8 patForms will pass the form or element object to the rule.
9 Rules can be applied before or after the built-in validation.
10
11 Rules allow custom validation like
12  * check if a two passwords match
13 or modify forms like:
14  * set the 'required' attribute based on the value of an element
15
16 $form->addRule( $myRule, PATFORMS_BEFORE_VALIDATION );
17 $form->addRule( $myRule, PATFORMS_AFTER_VALIDATION, true );
18 $element->addRule( $myRule, PATFORMS_AFTER_VALIDATION );
19
20 boolean addRule( object rule [, integer type = PATFORMS_AFTER_VALIDATION [, boolean revalidate = false]] )
21
22 See the examples for more documentation on rules.
Note: See TracBrowser for help on using the browser.