Re: HTML_QuickForm2_Captcha: How to handle validation
| From: | Alexey Borzov | Date: | Thu, 20 May 2010 07:39:11 +0000 |
| Subject: | Re: HTML_QuickForm2_Captcha: How to handle validation | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-53485@lists.php.net to get a copy of this message | ||
Hi Christian,
On 20.05.2010 11:19, Christian Weiske wrote:
I'm underway implementing the captcha element for QuickForm2. The code is available on github [1]. I started looking at the QF1 captcha element, and it does things a bit different. One of the bigger differences are captcha validation handling. The QF1 captcha requires you to add a rule "CAPTCHA" that takes care of validating it. My QF2 Captcha element however does implement that in the validate() method, without requiring the explicit addition of a rule. In my eyes, this is more developer friendly since he does not have to care about adding the rule himself, and captchas are to be solved - I can't think of a use case that shows a captcha and does not require it to be solved.Yes, that's the way to go with QF2. We already implemented validate() method in InputFile element that handles errors from PHP's $_FILES array and outputs relevant error messages. (BTW, we need translations for these error messages)