*/ $sections['Rule'] = array( 'descr' => 'These examples show the possibilities of form behavior and validation control of form and element rules. Rules allow you to create complex validations and to modify the form object depending on user input. A rule is an object that provides a method to apply the rule to the form or any element.', 'basename' => 'example_rule_', 'pages' => array( 'before' => array( 'title' => 'Applying a rule before form validation', 'descr' => 'This example shows how to use rules to modify a form before the validation takes place - here, we use this to set the phone field as required when the user clicks the "call me" checkbox.', 'tabs' => array( 'annotation' => array( 'title' => 'Notes', 'type' => 'text', 'text' => 'Note that the validation errors added by rules are stored in the special field __form, as those are really form-wide errors.', ), ), ), 'after' => array( 'title' => 'Applying a rule after from validation', 'descr' => 'This example shows how to process form data after it as been validated - here, we use a rule to make sure the two password fields are identical. As this only makes sense after both fields are valid, this rule is applied after the validation.', 'tabs' => array( 'annotation' => array( 'title' => 'Notes', 'type' => 'text', 'text' => 'Note that the validation errors added by rules are stored in the special field __form, as those are really form-wide errors.', ), ), ), 'element' => array( 'title' => 'Applying a rule to a single element', 'descr' => 'Most commonly rules are used to check/create dependencies between several form elements, but can also be applied to a single element for custom validation features.' ), 'conditionalenum' => array( 'title' => 'The Conditional Enum rule', 'descr' => 'Shows the conditional enum rule in action - this rule allows you to define which values are allowed in a field depending on the value of another.' ), 'conditionAnything' => array( 'title' => 'If there is anything, something else becomes required, too', 'descr' => 'This is just another application of the ConditionalRequired rules. By default this rules checks a specific value. In thius case there can by anything (the field must not be empty) to set other fields to required', ), 'remove' => array( 'title' => 'Removing a rule', 'descr' => 'This example shows how to remove a rule. The unique id of the rule is used to identify it.' ), 'format' => array( 'title' => 'Using the format attribute', 'descr' => 'The format attribute can be used to automatically add a rule. When setting the format more than once, the old rule will be removed automatically.' ), ) ); ?>