As would be defined according to the FAPI, a default value (i.e. of 'two') doesn't work:
'sample_radios' => array(
'#weight' => '3',
'#default_value' => 'two',
'#options' => array(
'one' => t('one'),
'two' => t('two'),
'three' => t('three'),
),
'#type' => 'radios',
'#title' => t('Sample radios'),
);
Nor does it work as in the TableForm module's own example with a default set (i.e. of 'array(2)'):
'my_radios' => array(
'#type' => 'radios',
'#title' => t('Radios'),
'#options' => array(
t('Apple'),
t('Orange'),
t('Banana'),
),
'#default_value' => array(2),
),
Comments
Comment #1
jlaaker commentedI tried many different things to set single radio-buttons, but so far the only solution I found was:
'#attributes' => ($value == 1)? array('checked' => 'checked'): ''