Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If you have 2 blocks with the same webforms on the page, they (and their content) haven't got unique HTML id tags.
In webform.module:
// Avoid building the same form twice on the same page request (which can
// happen if the webform is displayed in a panel or block) because this
// causes multistep forms to build incorrectly the second time.
$cached_forms = &drupal_static(__FUNCTION__, array());
if (isset($cached_forms[$node->nid])) {
$form = $cached_forms[$node->nid];
}
Comments
Comment #1
vejed CreditAttribution: vejed commentedComment #2
DanChadwick CreditAttribution: DanChadwick commentedI believe from the comment that multi-page forms requires that the ids be the same, even though this will make the form fail html validation. Under the circumstances, I think this is the best we can do.
I will ask quicksketch to comment directly. I would also think that is probably not a great user experience to see the exact same form on the page twice.
Comment #3
quicksketchYes, this functionality is intentional (as indicated by the code comments). It's not great that some modules (Panels) render the entire node twice on the same page, but only display them once. From the original issue, we had several complaints about CSS and conditionals breaking when used within a panel. In this case, it's the lesser of two evils.