? sites/default/files
? sites/default/settings.php
Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.297
diff -u -p -r1.297 form.inc
--- includes/form.inc	15 Oct 2008 14:17:26 -0000	1.297
+++ includes/form.inc	26 Oct 2008 14:36:14 -0000
@@ -1524,7 +1524,8 @@ function theme_fieldset($element) {
  *
  * @param $element
  *   An associative array containing the properties of the element.
- *   Properties used: required, return_value, value, attributes, title, description
+ *   Properties used: required, return_value, value, attributes, title,
+ *   description, id.
  * @return
  *   A themed HTML string representing the form item group.
  *
@@ -1536,10 +1537,20 @@ function theme_radio($element) {
   $output .= 'id="' . $element['#id'] . '" ';
   $output .= 'name="' . $element['#name'] . '" ';
   $output .= 'value="' . $element['#return_value'] . '" ';
+  if (!empty($element['#id'])) {
+    $output .= 'id="' . $element['#id'] . '" ';
+  }
   $output .= (check_plain($element['#value']) == $element['#return_value']) ? ' checked="checked" ' : ' ';
   $output .= drupal_attributes($element['#attributes']) . ' />';
   if (!is_null($element['#title'])) {
-    $output = '<label class="option">' . $output . ' ' . $element['#title'] . '</label>';
+    if (!empty($element['#id'])) {
+      // The 'for' attribute associates the label with the radio button allowing
+      // the user to select the radio button by clicking on the label's text.
+      $output = '<label class="option" for="' . $element['#id'] . '">' . $output . ' ' . $element['#title'] . '</label>';
+    }
+    else {
+      $output = '<label class="option">' . $output . ' ' . $element['#title'] . '</label>';
+    }
   }
 
   unset($element['#title']);
@@ -1936,7 +1947,8 @@ function theme_item($element) {
  *
  * @param $element
  *   An associative array containing the properties of the element.
- *   Properties used:  title, value, return_value, description, required
+ *   Properties used:  title, value, return_value, description, required,
+ *   attributes, id.
  * @return
  *   A themed HTML string representing the checkbox.
  *
@@ -1947,13 +1959,22 @@ function theme_checkbox($element) {
   $checkbox = '<input ';
   $checkbox .= 'type="checkbox" ';
   $checkbox .= 'name="' . $element['#name'] . '" ';
-  $checkbox .= 'id="' . $element['#id'] . '" ' ;
+  if (!empty($element['#id'])) {
+    $checkbox .= 'id="' . $element['#id'] . '" ' ;
+  }
   $checkbox .= 'value="' . $element['#return_value'] . '" ';
   $checkbox .= $element['#value'] ? ' checked="checked" ' : ' ';
   $checkbox .= drupal_attributes($element['#attributes']) . ' />';
 
   if (!is_null($element['#title'])) {
-    $checkbox = '<label class="option">' . $checkbox . ' ' . $element['#title'] . '</label>';
+    if (!empty($element['#id'])) {
+      // The 'for' attribute associates the label with the check box allowing
+      // the user to toggle the check box by clicking on the label's text.
+      $checkbox = '<label class="option" for="' . $element['#id'] . '">' . $checkbox . ' ' . $element['#title'] . '</label>';
+    }
+    else {
+      $checkbox = '<label class="option">' . $checkbox . ' ' . $element['#title'] . '</label>';
+    }
   }
 
   unset($element['#title']);
