Re: QuickForm radio button question
| From: | Tanner Postert | Date: | Fri, 18 Nov 2005 20:31:24 +0000 |
| Subject: | Re: QuickForm radio button question | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-21997@lists.php.net to get a copy of this message | ||
i found a solution using the setDefaults method:
$form->setDefaults(array(group=>element));
thanks.
On 11/18/05, Tanner Postert <tanner.postert@gmail.com> wrote:
>
> I have been trying everything i know to get the checked feature to work
> with radio buttons in quickform.
>
> i am creating a group of radio buttons, so i am using the method: $radio
> =&
>
> HTML_QuickForm::createElement('radio','name','label','text','value','attributes');
> then $form->addGroup($radio,'group','Group Label');
>
> for attributes i have tried array('checked') and
> array('checked'=>'checked') and array('checked'=>true), but
> i can't seem to
> get it to work.
>
> i have also tried with a normal addElement tag:
>
>
> $form->addElement('radio','name','label','text','value','attributes');
>
> I even tried modifying the radio.php file in HTML/QuickForm/ to include an
> if statement that says if (array_key_exists('checked',$attributes))
> $this->setChecked(); and i still get nothing. the html has no checked tag at
> all in it.
>
> Not sure if it matters, but i am using php 4.3.
>
> Thanks in advance for your help.
>
> Tanner
>