Re: [QuickForm] - Form rules?
| From: | Alexey Borzov | Date: | Tue, 24 Apr 2012 10:00:46 +0000 |
| Subject: | Re: [QuickForm] - Form rules? | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-31541@lists.php.net to get a copy of this message | ||
Hi Olaf,
On 24.04.2012 2:43, Olaf Gleba wrote:
Form rules in QF were special callbacks set with addFormRule(): http://pear.php.net/manual/en/package.html.html-quickform.html-quickform.addformrule.php They were given all form's values and could return errors for several form elements at once. In QF2 you can add a callback rule to the form, as is done in above tutorial, and it will receive all form's values. However it will set an error for the form itself, not for several elements in the form. A better approach is a custom rule subclass as written in my older email quoted by Mark.So I ran into this tutorial: http://ericlondon.com/using-pear-library-html-quickform2-create-simple-authentication-form-custom-validation-callback And I noticed that he does implement a form rule using a callback, I was under the impression that form rules didn't exist anymore ....Do you have any references for your suggestion? AFAIK form rules are still a main part of what QuickForm2 makes sweet and valuable.