Re: QuickForm::setDefaults
| From: | Bertrand Mansion | Date: | Mon, 03 Mar 2003 08:35:32 +0000 |
| Subject: | Re: QuickForm::setDefaults | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-4021@lists.php.net to get a copy of this message | ||
<lists@kriesing.de> wrote :
> why do i *have to* call setDefaults() before creating/adding the element?
> would it not be possible to setDefaults() afterwards? or am i
> missunderstanding something?
Hi Wolfram,
If an element has a default value, this value needs to be set before the
element is created. It is what a default value is meant for. If you need to
change an element value afterwards, use $element->setValue(); or maybe I
could add a $form->setValues($elementArr, $valuesArr) if you need it and
explain me what for.
Bertrand Mansion
Mamasam