0

I have custom validation on an element using ['#element_validate'].

But the element is within an accordion item within an accordion and the error doesn't signal to the parent elements to open up when the form is reloaded with the errors.

Is there a way to signal to an elements groups to open up when doing $form_state->setError($element) on an element?

enter image description here

2
  • Do you mean vertical tabs? gist.github.com/ivanjaros/90b5ad9822a7f824cd1b90b426ab4045
    – user21641
    Nov 15, 2017 at 19:53
  • They are part of the field_group module. They are literally called "Accordion item", but they behave similar to vertical tabs. I have added a screenshot of the config drop down from the form display config. It has different css from vertical tabs: "required-fields field-group-accordion-item field-group-format-wrapper ui-accordion-content ui-corner-bottom ui-helper-reset ui-widget-content ui-accordion-content-active"
    – oknate
    Nov 15, 2017 at 19:56

1 Answer 1

1

I have added this an issue on the field_group module and have posted a patch: https://www.drupal.org/project/field_group/issues/2923831

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.