By Trappies on
Hi,
I am sitting with a bit of a problem. I am trying to group a set of radio buttons that form part of different entities. Let me give the setup atm:
I have x amount of groups that I list like this:
[Group Name] [Description] [Total Members] [RADIO BUTTON]
[Group Name] [Description] [Total Members] [RADIO BUTTON]
[Group Name] [Description] [Total Members] [RADIO BUTTON]
...
[Group Name] [Description] [Total Members] [RADIO BUTTON]
So now in code I have this:
$form['g_details'] = array(
'#type' => 'fieldset',
'#title' => t('Available Groups'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
'#tree' => TRUE,
'#theme' => 'group_listing_form',
);
for ($i=0; $i < $group_count; $i++)
{
$form['g_details'][$i]]['group_name'] = array(
'#type' => 'markup',
'#prefix' => '<div>',
'#value' => '<b>' . $group['name'] . '</b>',
'#suffix' => '</div>',
);
$form['g_details'][$i]]['group_description'] = array(
'#type' => 'markup',
'#prefix' => '<div>',
'#value' => '<b>' . $group['description'] . '</b>',
'#suffix' => '</div>',
);
$form['g_details'][$i]]['group_amount'] = array(
'#type' => 'markup',
'#prefix' => '<div>',
'#value' => '<b>' . $group['amount'] . '</b>',
'#suffix' => '</div>',
);
$form['g_details'][$i]['join_group'] = array(
'#type' => 'radio',
'#title' => 'Join this clan',
'#value' => $i,
);
}
I get it to display correctly and it's all nicely themed, but when I select a radio and select a different one they are all selected. I need for only 1 to be selected. Anyone know a way to group them?
Thanks in advance.
Davin
Comments
?
Any ideas?