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.
Normally on the form with "preview" option where a mandatory field is not filled out the warning appears (like: please fill out this field"). When the required filed(s) is/are in the fieldset that is not collapsed, warnings are presented but when the fieldset is collapsed and fields are not visible, there are no warnings about mandatory fields. Because the Preview button in such case does not work a user may do not understand why he/she cannot go further with the form preview.
Comments
Comment #2
vooveek CreditAttribution: vooveek commentedComment #3
DanChadwick CreditAttribution: DanChadwick commentedI would consider it poor UI design to put a required element inside a collapsible fieldset for just this reason. It might be reasonable for Webform to expand fieldsets when there is a validation error, but this would be a feature, not a bug report. Webform acting according to the specifications you gave it, so I don't consider this a bug.
Comment #4
quicksketchYeah I could go either way on this being bug or feature. I think if implemented (either as a bug fix or feature), that we should expand collapsed fieldsets that contain required fields on validation as the default (and probably only) behavior. I agree putting required fields in collapsed fieldsets in the first place may be poor form design, but it's bound to happen.
Comment #5
44sunsets CreditAttribution: 44sunsets commentedI got stung by this recently -- I made some fields required inside a collapsed fieldset, and when you try to submit the form without filling in these fields, nothing happens at all. Very confusing for the user who is given no clues as to what's wrong.
I wrongly assumed that fields which are hidden/collapsed do not undergo validation (as is the case when required fields are conditionally hidden using Webform > Conditionals rules).
I'm going to work around this by setting up some Webform Conditionals rules to show/hide the fields, instead of collapsing the fieldset.