summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2006-02-02 02:10:31 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2006-02-02 02:10:31 +0000
commitb0051893981780d7619c180aaa6a5fca7adfb039 (patch)
treef9025a740a2af5e612b6b7350867464522a0729d /includes
parentcebc8843314bd626268ee4fcdc21a1af6e9a4008 (diff)
downloadbrdo-b0051893981780d7619c180aaa6a5fca7adfb039.tar.gz
brdo-b0051893981780d7619c180aaa6a5fca7adfb039.tar.bz2
- #42083: Form API IP should be xhtml id of <form> tag
Diffstat (limited to 'includes')
-rw-r--r--includes/form.inc5
1 files changed, 4 insertions, 1 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 742d23a1f..391a9a33f 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -71,6 +71,9 @@ function drupal_get_form($form_id, &$form, $callback = NULL) {
$form['form_token'] = array('#type' => 'hidden', '#default_value' => md5(session_id() . $form['#token'] . variable_get('drupal_private_key', '')));
}
$form['form_id'] = array('#type' => 'hidden', '#value' => $form_id);
+ if (!isset($form['#id'])) {
+ $form['#id'] = $form_id;
+ }
$form = array_merge(_element_info('form'), $form);
@@ -847,7 +850,7 @@ function theme_textfield($element) {
function theme_form($element) {
// Anonymous div to satisfy XHTML compliancy.
$action = $element['#action'] ? 'action="' . check_url($element['#action']) . '" ' : '';
- return '<form '. $action . ' method="'. $element['#method'] .'" '. drupal_attributes($element['#attributes']) .">\n<div>". $element['#children'] ."\n</div></form>\n";
+ return '<form '. $action . ' method="'. $element['#method'] .'" '. 'id="'. $element['#id'] .'"'. drupal_attributes($element['#attributes']) .">\n<div>". $element['#children'] ."\n</div></form>\n";
}
/**