summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/form.inc4
1 files changed, 4 insertions, 0 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 4dcd14391..74d8f54b1 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -1548,6 +1548,9 @@ function expand_radios($element) {
if (count($element['#options']) > 0) {
foreach ($element['#options'] as $key => $choice) {
if (!isset($element[$key])) {
+ // Generate the parents as the autogenerator does, so we will have a
+ // unique id for each radio button.
+ $parents_for_id = array_merge($element['#parents'], array($key));
$element[$key] = array(
'#type' => 'radio',
'#title' => $choice,
@@ -1555,6 +1558,7 @@ function expand_radios($element) {
'#default_value' => isset($element['#default_value']) ? $element['#default_value'] : NULL,
'#attributes' => $element['#attributes'],
'#parents' => $element['#parents'],
+ '#id' => form_clean_id('edit-'. implode('-', $parents_for_id)),
);
}
}