Re: HTML_Quickform Bug on setDefaults and/or setValue with text fields

From: Date: Sun, 11 Jul 2004 22:53:26 +0000
Subject: Re: HTML_Quickform Bug on setDefaults and/or setValue with text fields
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-13643@lists.php.net to get a copy of this message
Alexey Borzov wrote:
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.
Thanks Alexey, that was the answer. -- Del

« previous php.pear.general (#13643) next »