Home › Forums › Front-end Issues › Programmatically changing tabs on acf_form() (Front-end forms) › Reply To: Programmatically changing tabs on acf_form() (Front-end forms)
The only way I know of to programmatically switch tabs you are going to have to find the tab element and trigger a click on the tab link “a” element.
To find the current tab
$('.acf-tab-wrap li.active')
how you would identify the previous/next tab I’m not really sure about.
I would possibly construct some type of javascript array or object containing a list of all of the tabs on page load and then use that array/object to somehow figure out what the next/previous tab is when the link/button is clicked.
I might also do something like set an ID (in javascript) or another data attribute on each “a” element in the list and then get the value of the “active” item and determine the next/previous using this when clicked, for example add ‘data-order=”1″‘ // 2, 3, etc.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.