Re: Quickform validation problem
| From: | Alexey Borzov | Date: | Tue, 20 Oct 2009 13:08:04 +0000 |
| Subject: | Re: Quickform validation problem | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-30099@lists.php.net to get a copy of this message | ||
Hi,
Mark Wiesemann wrote:
(second try, forgot to CC pear-general list) Hi Florian, Florian van Eerd wrote:This won't help, validate() already checks isSubmitted(). The proper solution is to use $trackSubmit parameter of QuickForm's constructor, that's mentioned in the FAQ: http://pear.php.net/manual/en/package.html.html-quickform.intro-faq.php/* Begin PHP */ $form = new HTML_QuickForm('firstForm', 'GET');[...]if($form->validate()) {You're validating the form every time here. Better solution: if ($form->isSubmitted() && $form->validate()) {