You can use setOptions() on an existing element:
$radio = $form->getElement('my_radio');
$radio->setOptions(array(
    'disable' => array(1, 2)
));

--
Hector


On Thu, Jul 30, 2009 at 11:24 AM, Chris MacPherson <[email protected]>wrote:

>  Hi,
>
> The only problem is that I am using a form that already exists. I am trying
> to alter it after it has already created but the 'disable' option doesn't
> appear to help me in this case. I might just remove the option instead and
> leave a message indicating the fact.
>
> Thanks though,
>
> Chris
>
>
> Hector Virgen wrote:
>
> You can pass in a "disable" option when you create the element. It accepts
> an array of radio IDs to disable, or true to disable them all.
>  $form->addElement('radio', 'foo', array(
>  'multiOptions' => array(
>  1 => 'one',
>  2 => 'two',
>  3 => 'three'
>  ),
>  'disable' => array(3) // disables only radio 3
> ));
>
> --
> Hector
>
>
> On Thu, Jul 30, 2009 at 10:33 AM, Chris MacPherson <[email protected]>wrote:
>
>> Hi,
>>
>> I have a form that contains a group of radio buttons. I would like to
>> disable one of the radio options. I cant quite work out how to do this or
>> find out if it is even possible?
>>
>> Thanks if you can help :)
>>
>> Chris
>>
>
>

Reply via email to