Re: setDefaults for radio buttons
| From: | Justin Patrin | Date: | Mon, 11 Oct 2004 18:30:58 +0000 |
| Subject: | Re: setDefaults for radio buttons | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-14850@lists.php.net to get a copy of this message | ||
On Mon, 11 Oct 2004 11:48:13 +0100, Ellen Sundh <ellen@digitlondon.com> wrote:
> 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?
>
Looks like that should work to me.
Try looking at this thread, we just talked about this:
http://marc.theaimsgroup.com/?t=109666130800001&r=1&w=2
--
paperCrane --Justin Patrin--