From 5030ea40a51b0d6527f5d43519cdbf0a3cca0c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Tue, 11 Sep 2007 17:23:58 +0000 Subject: #150851 by pwolanin and chx: different radio buttons in the same set should have different HTML id values (XHTML validity fix) --- modules/filter/filter.module | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules') diff --git a/modules/filter/filter.module b/modules/filter/filter.module index c3d07c661..a37bf91ee 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -794,6 +794,9 @@ function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = NULL, $parents = ); // Multiple formats available: display radio buttons with tips. foreach ($formats as $format) { + // Generate the parents as the autogenerator does, so we will have a + // unique id for each radio button. + $parents_for_id = array_merge($parents, array($format->format)); $form[$format->format] = array( '#type' => 'radio', '#title' => $format->name, @@ -801,6 +804,7 @@ function filter_form($value = FILTER_FORMAT_DEFAULT, $weight = NULL, $parents = '#return_value' => $format->format, '#parents' => $parents, '#description' => theme('filter_tips', _filter_tips($format->format, FALSE)), + '#id' => form_clean_id('edit-'. implode('-', $parents_for_id)), ); } } -- cgit v1.2.3