Radiobuttonlist - Disable Individual Options

Hi all,

Is there an option to disable individual radio fields in a radioButtonList? Could not find any clue anywhere unfortunately.

Eg.

$form->radioButtonList($data, ‘list1’,

array(‘option1’=>‘xxx’,‘option2’=>‘yyy’),

array(‘disabled’=>true));

works for disabling the whole radioButtonList. However, I’d like to just disable the field for option1 in the above example.

Any hint is much appreciated!

Many thanks in advance,

Hugo

use this code .

$form->radioButtonList($data, ‘list1’,

array(‘option1’=>‘xxx’,‘option2’=>‘yyy’), array(‘options’ => array(‘option1’=>array(‘disabled’=>true))));

Many thanks for the fast answer!

However, this code does not seem to work unfortunately, as I get a "htmlspecialchars() expects parameter 1 to be string, array given" error.

Any ideas?

Many thanks,

Hugo

assign/put parameter in htmlspecialchars parentheses. like this:

<?php

$new = htmlspecialchars("<a href=‘test’>Test</a>", ENT_QUOTES);

echo $new; // &lt;a href='test'&gt;Test&lt;/a&gt;

?>

for detail information:

http://php.net/manual/en/function.htmlspecialchars.php

Hi all,

According to the documentation (http://www.yiiframework.com/doc/api/1.1/CHtml#activeRadioButtonList-detail) activeRadioButtonList does not have options as part of $htmlOptions available or am I missing something here? Does that mean that individual radio buttons cannot be disabled?

Many thanks,

Hugo