Re: QuickForm problem

From: Date: Fri, 02 Jan 2004 18:09:23 +0000
Subject: Re: QuickForm problem
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-9915@lists.php.net to get a copy of this message
<cesare@ngi.it> wrote : > Alle 17:33, venerdì 2 gennaio 2004, Bertrand Mansion ha scritto: >> The validate() line looks weird here... But that's up to you, it >> depends whether you are validating the form before showing it or >> validating another form. > > Why weird? (real question, no polemics). I'm a total newbie to QF, so > any hint is appreciated :) > I'm using validate() to decide whether I have to show the form [again], > or if I should update the db -- took that way of doing from an > introductory article on an Italian magazine. You mean there was an article about QuickForm in an Italian article ? Cool ! :) Any url ? Usually, you validate your form once it is built. So basically you do: 1. new HTML_QuickForm 2. set the defaults 3. add the elements 4. validate 5. if validate ok, do something (ie. update db, then header('Location:...')) 6. otherwise display() 3 can come before 2 if you prefer (me not). There are a few examples in the docs/ directory Bertrand Mansion Mamasam

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