summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
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 826b6777b..fa49839e4 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -850,7 +850,10 @@ function drupal_process_form($form_id, &$form, &$form_state) {
// cache when a form is processed, so scenarios that result in
// the form being built behind the scenes and again for the
// browser don't increment all the element IDs needlessly.
- drupal_static_reset('drupal_html_id');
+ if (!form_get_errors()) {
+ // In case of errors, do not break HTML IDs of other forms.
+ drupal_static_reset('drupal_html_id');
+ }
if ($form_state['submitted'] && !form_get_errors() && !$form_state['rebuild']) {
// Execute form submit handlers.