Re: QuickForm basics

From: Date: Wed, 01 Oct 2003 16:48:57 +0000
Subject: Re: QuickForm basics
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8197@lists.php.net to get a copy of this message
To be honest I looked at the HTML_QuickForm_Controller examples and said to myself "huh". I'm fairy new to PHP and I understand functions pretty well but to write a class to use another class, to display a 3 page form sesms pretty over the top and more complicated than my brain can understand right now. There may be less lines of code but if it takes more time to write that code becuase of the complexity I loose ground. Keith Bertrand Mansion wrote:
<keith@setuplinux.com> wrote :
Ahhh ok. So from what everybody is telling me I can create the form and submit it with no error checking, or I get error checking and can't submit the data anywhere unless I do a if ($form->validate()) { header('Location: client.php?var1=$var1&foo=$bar'); } and resend all the variables I want to go to the next form. I understand that the forms needs to submit to itself in order to provide the error checking (smart idea btw) but I would think that you should just be able to declare in the HTML_QuickForm or the submit button or somewhere to do the header() redirect thing with all the form variables if it's vaildated. That would seem to save alot of coding.
I am glad you came to that conclusion by yourself ;) You can process the form values right after your $form->validate() and just before your header('Location'). But if you really need to pass them from form 1 to form 2, use HTML_QuickForm_Controller because as you said, "that would save a lot of coding" and is also a much safer way to handle your situation. Bertrand Mansion Mamasam


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