Initialize all form components
I have a form with tabs and repeatable panels.
On load I'd like to run some jQuery and interrogate some fields that are on other tabs which are hidden on 1st load.
But the jQuery cannot find the elements in the DOM until the user has visited the tabs.
I have been able to work around this in code by setting focus to each panel, and back to the first panel with code.
This simulates a user visiting the tabs. Now the DOM elements on the tabs are accessible.
I'm stuck with repeatable panels. Hidden accordion panels cannot be read by jQuery until the user clicks on them to reveal them.
How do I loop over and set focus on these instances?
Is there a better way to "initialize" all the fields in all the panels (including hidden and hidden/repeated) on load of the form?
I'm hoping for a magic 'initialize all' script that will make sure all the DOM is loaded without the user having to click on everything and i won't have to write this silly code.