setDefaults for radio buttons
| From: | Ellen Sundh | Date: | Mon, 11 Oct 2004 10:48:13 +0000 |
| Subject: | setDefaults for radio buttons | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-14841@lists.php.net to get a copy of this message | ||
Hi!
I use HTML_QuickForm to sumbit a form. I have one row of radiobuttons.. They
all work fine when I submit the form but when I want to edit the form, I
want to show the chosen value for the radio buttons.. that I got from a
database. I tried to use setDefaults but without any luck. :(
This is the code I am using to create the radio buttons..
$types[] =&
HTML_QuickForm::createElement('radio',null,null,'None','None');
$types[] =& HTML_QuickForm::createElement('radio',null,null,'Live
Session','Live Session');
$types[] =& HTML_QuickForm::createElement('radio',null,null,'Selected
Remix','Selected Remix');
$form->addGroup($types,"type_0","Type: "," ");
For setting the value I use something like this:
$this->form->setDefaults(array("type_0"=>"My default value")) ;
Am I heading in the right direction?
Thanks in advance!
Ellen Sundh