Re: QuickForm: How to set a form variable without setDefaults()?
| From: | Bertrand Mansion | Date: | Thu, 20 Mar 2003 11:17:18 +0000 |
| Subject: | Re: QuickForm: How to set a form variable without setDefaults()? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-4328@lists.php.net to get a copy of this message | ||
<M.Kaening@osram.de> wrote :
> Hi,
>
> how do I properly set a form variable without setDefaults()? Suppose I
> process a previously submitted form and before validation I want to change
> the contents of a (e.g. hidden) variable. How to do that? I know there is
> the setValue() method, but it's not implemented for a lot of element
> classes. Is there a proper way to achieve that without rewriting all the
> necessary setValue() methods?
Hi,
- Submitted values override default values.
- HTML_QuickForm_Element extends HTML_Common which has a updateAttributes()
method.
- Input type elements extend HTML_QuickForm_Input which has a setValue()
method.
- Hidden element values can be set using addElement('hidden', 'myhidden',
'my value')
> Looks like I still haven't understood the way this form lib works. Up to
> now I used phplib's oohforms together with phplib's template, but wanted
> to give PEAR a chance... I am awaiting the new release of QuickForm with
> integrated templates (ITX), but thought I might try as well the current
> status. Who knows, I hope there will be a seamless transition also of the
> API with the next template-containing QF release...
>
> Marko
Bertrand Mansion
Mamasam