How to switch among tab-breaks using JS?

For example, I have five tab-breaks in my form, and I want to switch among them using JavaScript code.

One way is to scroll to any field or first field in the tab you want to switch to



you can trigger click event on particular tab.
Tab name is form_settings_tab
id = <doctype-name>-<tab-name>-tab


1 Like

if you have access to the docfield that is tab then you can also just call

1 Like

thank you for your reply, both methods work fine.
In my opinion, triggering the click event is more efficient.
But I have found that adding the <doctype-name> does not work.
It simply works with $("#user-<field-name>-tab").trigger("click") where field-name is the field-name of the Tab-Break field

1 Like

thank you for your reply, but unfortunately, I have found the followings: throws ReferenceError: <docfield> is not defined or throws TypeError: Cannot read properties of undefined (reading 'tab')

Frappe Framework: v14.x.x-develop () (develop)