Re: Quickform validation problem

From: Date: Tue, 20 Oct 2009 13:24:30 +0000
Subject: Re: Quickform validation problem
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-30100@lists.php.net to get a copy of this message
Thanks a lot! That actually seems to work! 2009/10/20 Alexey Borzov <borz_off@cs.msu.su> > Hi, > > > Mark Wiesemann wrote: > >> (second try, forgot to CC pear-general list) >> >> Hi Florian, >> >> Florian van Eerd wrote: >> >>> /* 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()) { >> > > 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 >

« previous php.pear.general (#30100) next »