Is it planed, to implement the same functionality for horizontal tabs as it is implemented for vertical tabs?
I would be happy, if it is!

If not, does someone know how to implement this in a appropriate way?

CommentFileSizeAuthor
#11 clientvalidationconfig.png18.23 KBfishfree

Comments

attiks’s picture

What module are you using for horizontal tabs?

jelle_s’s picture

Status: Active » Fixed

fixed in latest dev

iTiZZiMO’s picture

Thank you for fixing it.

I am using the field_group Module for horizontal-tabs.

attiks’s picture

It should work with field_group but all elements on all tabs are validated including the hidden ones. For vertical tabs this is a setting.

iTiZZiMO’s picture

It works, thanks. But i found another issue, which may be interesting for you.

In the code, there is this block:

// Same for horizontal tabs
fieldset = $(element).parents('fieldset.horizontal-tabs-pane');
if (fieldset.size() && fieldset.find('.' + errorClass).size() == 0) {
  tab = self.findHorizontalTab(element);
  if (tab) {
    tab.removeClass(errorClass).addClass(validClass);
  }
}

When validating, this code checks for fields inside the tab, which have the error class. If you already validated, there is the error message shown. This message has also the class "error" and is only hidden, when the field is valid. The code above does select these error messages and does not go into the first IF.

I figured out, that appending .not('label') onto the .find('.' + errorClass) does the trick.
Is this a good method or do you have a better one?

attiks’s picture

Version: 7.x-1.31 » 7.x-1.x-dev
Assigned: Unassigned » jelle_s
Status: Fixed » Needs work

I've to check with Jelle_S

jelle_s’s picture

You're right. Fixed in latest dev version.

jelle_s’s picture

Status: Needs work » Fixed
jelle_s’s picture

Assigned: jelle_s » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

fishfree’s picture

Issue summary: View changes
Status: Closed (fixed) » Active
StatusFileSize
new18.23 KB

I still can not get it work with fieldgroup horizontal tab. I use the configuration as below:
client validation config

When I click on Save button, all required fields on non-current tab trigger validation.

Collapsed fieldset (provided also by fieldgroup module) can bypass the required fields validation when clicking on save button.