diff --git a/webform.module b/webform.module
index d142178..8fc4dd0 100644
--- a/webform.module
+++ b/webform.module
@@ -2903,7 +2903,6 @@ function theme_webform_element($variables) {
   if (isset($element['#title_display']) && strcmp($element['#title_display'], 'inline') === 0) {
     $wrapper_classes[] = 'webform-container-inline';
   }
-  $output = '<div class="' . implode(' ', $wrapper_classes) . '" id="webform-component-' . $parents . '">' . "\n";
 
   // If #title is not set, we don't display any label or required marker.
   if (!isset($element['#title'])) {
@@ -2912,6 +2911,18 @@ function theme_webform_element($variables) {
   $prefix = isset($element['#field_prefix']) ? '<span class="field-prefix">' . _webform_filter_xss($element['#field_prefix']) . '</span> ' : '';
   $suffix = isset($element['#field_suffix']) ? ' <span class="field-suffix">' . _webform_filter_xss($element['#field_suffix']) . '</span>' : '';
 
+  // Remove the #id property if there are multiple child elements to prevent the
+  // label from being including a "for" attribute to a non-existant field.
+  if (count(element_children($element))) {
+    $output = '<fieldset>';
+    $output .= '<legend>' . $element['#title'] . '</legend>';
+    $output .= ' ' . $prefix . $element['#children'] . $suffix . "\n";
+    $output .= '</fieldset>';
+    return $output;
+  }
+
+  $output = '<div class="' . implode(' ', $wrapper_classes) . '" id="webform-component-' . $parents . '">' . "\n";
+
   switch ($element['#title_display']) {
     case 'inline':
     case 'before':
