Re: QuickForm Question
| From: | Jeroen Houben | Date: | Tue, 28 Oct 2003 15:05:48 +0000 |
| Subject: | Re: QuickForm Question | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-8649@lists.php.net to get a copy of this message | ||
James 'Chip' Kaufman wrote:
I thought I would try rephrasing my question in hopes that someone can point me to the code bit that is causing my problem. This is how it looks to me. I have two independent pages of an application. Each instantiates a QuickForm object. Page 1 creates three text elements, "element1", "element2", and "element3". These get submitted to Page 2 using the POST method. On page two, I create two PHP variables - one is $element1, the other $element2. They may or may not have the same values as the variables from Page 1. I instantiate a form and set default values for 'element1' and 'element2' to $element1 and $element2, respectively. However, when I display the form I see the submitted values, rather than the ones that I set as defaults. Why is this happening? Where in the code does Quickform give preference to submitted data over explicitly set default data? Hi James,That is how QF works. That's what defaults are. If you want to load "defaults" no matter what you should use setConstants. Or you could explicitly set the value of your elements using $element->setValue('MyDefaultValue'); HTH Jeroen