Home Forums General Issues Determine which tab belongs to a field


Determine which tab belongs to a field

  • How can I determine which tab belongs to a field using JS in the admin?
    When inspecting I couldn’t see any class/attributes on the tab that relates it to the fields that it shows/hide on click.
    I want to be able to trigger a click on the tab that shows the field I selected using JS.

  • The link in the tab
    <a href="" class="acf-tab-button" data-placement="top" data-endpoint="0" data-key="field_61719047e2a83">tab 1</a>

    data-key is the tab field’s field key. The actual tab field is hidden in the field group where it normally should appear.

    <div class="acf-field acf-field-tab acf-field-61719047e2a83" data-type="tab" data-key="field_61719047e2a83"> ....

    The fields in this tab are all of the fields in the field group that come after the tab field (the hidded element) and before the next tab field or the end of the group, or possible the end of the “parent” field when the tab is in a repeater, group, or flex field.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.