I have a radio button group like this:
$options = array('2' => t('Active (2)'), '1' => t('Upcoming (1)'), '0' => t('Finished (0)'));
$form['active'] = array(
'#type' => 'radios',
'#title' => t('Update state:'),
'#default_value' => $default_entry->active,
'#options' => $options,
);
which works fine. However, based on a drop-down list of entries, it calls an ajax function which should update the selection:
foreach (array('name', 'test') as $item) {
$form[$item]['#value'] = $entry->$item;
}
foreach (array('active') as $item) {
???
}
Now, the "name" and "test" work as expected as they are text fields.... but the active radio button stays the same as it was (i.e. based on the '#default_value').
I have tried
$form[$item]['#value'] = $entry->$item;
$form[$item]['#default_value'] = $entry->$item;
but neither change which radio button is selected. Is there something I'm missing based on updating the "checked" attribute for that radio group?
Any help and/or points in the right direction much appreciated.