Re: HTML_Quickform Bug on setDefaults and/or setValue with text fields
| From: | Alexey Borzov | Date: | Sun, 11 Jul 2004 21:40:37 +0000 |
| Subject: | Re: HTML_Quickform Bug on setDefaults and/or setValue with text fields | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-13642@lists.php.net to get a copy of this message | ||
Hi,
Del wrote:
// Reset some values to defaults. BUG: This doesn't work -- the form keeps its values from // the last submit, even though a print_r of the element reveals that it has been set // to null. // $element = $form->getElement('atextfield'); $element->setValue('12341234');Should be: $element =& $form->getElement('atextfield'); Currently you change the value of a copy of the element. Of course this does not affect the original element in the form.