Re: QF rules as notices
| From: | Alexey Borzov | Date: | Thu, 22 Apr 2004 09:27:35 +0000 |
| Subject: | Re: QF rules as notices | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-12017@lists.php.net to get a copy of this message | ||
Hi!
André Temme wrote:
I'd like to to add kind of notices to my form. If the user submits a value in a field for which this notice is valid, the notice should be displayed after the first submit. If the user decides to "ignore" the notice he can now submit. As long as there are real errors added by addRule(), the form shall be displayed with the messages from the errors and the messages from the notices. Can this be done? How? :-)You definitely won't be able to do this via builtin QuickForm rules. Though you can write your own: 1) Rule class / callback to add via addRule() / addGroupRule(); 2) callback for addFormRule(). These should check whether the form is submitted for the second time (this is left as the excercise for the reader) and just return true in this case.