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

Kris77 created an issue. See original summary.

carolpettirossi’s picture

The same issue occurs on 8.x-1.0-rc6.

Stockticker’s picture

It'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.

geek-merlin’s picture

Title: Don't show error for field required » Make user aware of clientside HTML5 validation error in hidden tab
geek-merlin’s picture

Title: Make user aware of clientside HTML5 validation error in hidden tab » Fix visibility of invalid HTML5-validated fields
Related issues: +#1797438: HTML5 validation is preventing form submit and not fully accessible, +#2894213: Ensure visibility of invalid fields (serverside)
geek-merlin’s picture

Title: Fix visibility of invalid HTML5-validated fields » Ensure visibility of invalid HTML5-validated fields
swentel’s picture

Status: Active » Postponed

Funky, will wait what core decides on this. Unless someone else has an amazing idea to listen to these kind of errors.

swentel’s picture

Status: Postponed » Closed (duplicate)

Actually, #2969051: HTML5 Validation Prevents Submission in Tabs has a patch which might solve at least a few problems, let's take it over there.