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.
Hi guys,
i have tried to create a TABS group(horizontal) with Tab1 & Tab2 in user profile.
So, in Tab2 there are required fields, and i'm editing fields in TAB1.
If i click on "CREATE NEW USER" button nothing happens(because there are required fields in TAB2) but no mandatory field message is displayed.
I use DRUPAL 8.35 with Field GROUP 8.x.3-dev
Comments
Comment #2
carolpettirossi CreditAttribution: carolpettirossi at CI&T for Pfizer, Inc. commentedThe same issue occurs on 8.x-1.0-rc6.
Comment #3
Stockticker CreditAttribution: Stockticker at Internetdevels commentedIt's not more like a bug, but the fact, that client-side validation (built-in HTML5 field validation in Drupal 8) is triggered before server-side (Drupal and module's validation handlers) - so since you are on other tab, HTML5 browser messages are not visible (because messages are displayed in the other tab, where required fields are not filled out) and it feels like nothing is happening.
I've found quite simple solution for this - disable HTML5 validation for particular form (with a hook_form_alter and $form['#attributes']['novalidate'] = 'novalidate')to make sure Drupal's validation behavior will be fired up.
After that, not filling up required fields will open up closed tabs field-group and trigger usual Drupal error messages.
Comment #4
geek-merlinComment #5
geek-merlinComment #6
geek-merlinComment #7
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commentedFunky, will wait what core decides on this. Unless someone else has an amazing idea to listen to these kind of errors.
Comment #8
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commentedActually, #2969051: HTML5 Validation Prevents Submission in Tabs has a patch which might solve at least a few problems, let's take it over there.