Re: QuickForm question...
| From: | R. Cole | Date: | Tue, 13 Aug 2002 17:52:17 +0000 |
| Subject: | Re: QuickForm question... | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-2105@lists.php.net to get a copy of this message | ||
Thanks for the advice. I'm still having a hard time getting the hang of
this - I've looked at the two examples provided with QuickForm, but
neither really show me how to do much with it. I'm probably being dense,
of course. :-)
Anyway, here's what I've got going so far:
The script is being used right now to edit some database fields. It
displays all the fields and data just fine, and I used:
$form->addElement('submit', null, 'Submit');
To create the submit button. Then I have the example to validate and
process the form:
if ($form->validate())
{
$form->freeze();
$form->process();
echo "DONE";
}
However, before the data is even entered, this shows up when I run the
script:
array(1) {
["person_id"]=>
string(1) "1"
}
array(0) {
}
DONE
It appears to me that the form is saying it's been validated, even before
the data is submitted. Any ideas what I'm doing wrong?
Here's the full code, in case you want to see how much of a newbie to
programming I am. :-)
http://www.pcthike.com/quickform.phps
thanks,
Rob Cole
:----------------------------------------------------------------------:
: Rob Cole : America is the only nation in history :
: colerl@u.washington.edu : which miraculously has gone directly :
: Biostatistics : from barbarism to degeneration without :
: : the usual interval of civilization. :
: : - Clemenceau :
:----------------------------------------------------------------------:
On Tue, 13 Aug 2002, Martin Tsachev wrote:
> On Tue August 13 2002 2:46 am, R. Cole wrote:
> > I'm trying to use QuickForm to process a bunch of information, and am not
> > having much luck learning about how to properly use the $form->process()
> > function. From what I see, it utilizes var_dump to dump the variables,
> > but I can't see the reasoning behind it.
>
> Yes this is an abstract function, there's no reason to use it at all.
>
> > Anyway, I'm mainly wondering if there is an easier method to doing this.
> > All I want to do is run a MySQL insert query based on the information in
> > the form; however, for the time being, I can't figure out where to insert
> > that code.
>
> So what's the problem to extract the processed information?
> $obj->getSubmitValue() and $obj->getElementValue() return the element value
> after and before processing.
>
> > Any help would be greatly appreciated. I'm a bit new to PHP, so this code
> > is still quite over my head. :)
>
> --
> Martin Tsachev
> Web developer
>
> http://martin.f2o.org
>
>