summaryrefslogtreecommitdiff
path: root/includes/form.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/form.inc')
-rw-r--r--includes/form.inc9
1 files changed, 7 insertions, 2 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 7ddd6125d..daf164368 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -2200,7 +2200,7 @@ function form_process_container($element, &$form_state) {
* @param $element
* An associative array containing the properties and children of the
* group.
- * Properties used: #children.
+ * Properties used: #id, #attributes, #children.
* @return
* A themed HTML string representing the form element.
*
@@ -2208,7 +2208,12 @@ function form_process_container($element, &$form_state) {
*/
function theme_container($variables) {
$element = $variables['element'];
- return '<div class="form-wrapper" id="' . $element['#id'] . '">' . $element['#children'] . '</div>';
+ if (!isset($element['#attributes']['id'])) {
+ $element['#attributes']['id'] = drupal_html_id($element['#id']);
+ }
+ // Force the 'form-wrapper' class.
+ $element['#attributes']['class'][] = 'form-wrapper';
+ return '<div' . drupal_attributes($element['#attributes']) . '>' . $element['#children'] . '</div>';
}
/**