QuickForm: setValue with select elements
| From: | Damien Cros | Date: | Thu, 10 Nov 2005 17:36:06 +0000 |
| Subject: | QuickForm: setValue with select elements | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-21874@lists.php.net to get a copy of this message | ||
Hi,
I can't find the right way to use setValue with a select element.
$options = array(1=>'yes', 2=>'no');
$myselect = $form->addElement ('select', 'myselect', '', NULL);
$myselect->setValue($options);
doesn't work.
but
$myvalue = "thing";
$mytext = $form->addElement('text', 'mytext', '');
$mytext->setValue($myvalue);
does.
What should I do?
damien
Attachment: [application/pkcs7-signature] smime.p7s
Attachment: [application/pkcs7-signature] smime.p7s