Re: using QuickForm with $_GET variable for default id - when it processes there is no variable in URL so it throws error
| From: | I. M. Bur | Date: | Fri, 07 Jan 2005 15:07:47 +0000 |
| Subject: | Re: using QuickForm with $_GET variable for default id - when it processes there is no variable in URL so it throws error | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16783@lists.php.net to get a copy of this message | ||
> > .... element definition ...
>
> If you want the ID to persist, set up a hidden element in the form
> (this is probably your problem).
>
> $form->addElement('hidden', 'ident', $ID);
It's not the first time someone makes this mistake. addElement() does
not take the element's value as one of the parameters. Instead you
have to use setValue() or setDefaults() afterwards. I would really
like to set it's value like this, but it is simply not the case.
See here:
http://pear.php.net/manual/en/package.html.html-quickform.html-quickform.addelement.php
http://pear.php.net/manual/en/package.html.html-quickform.html-quickform-element.setvalue.php
http://pear.php.net/manual/en/package.html.html-quickform.html-quickform.setdefaults.php
--
I. M. Bur
buralien@gmail.com