Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Initialize all form components

Avatar

Avatar
Validate 1
Level 1
Ryano_DE
Level 1

Likes

0 likes

Total Posts

12 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back
View profile

Avatar
Validate 1
Level 1
Ryano_DE
Level 1

Likes

0 likes

Total Posts

12 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back
View profile
Ryano_DE
Level 1

20-04-2021

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.

focus form initialization

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

310 likes

Total Posts

1,131 posts

Correct Reply

184 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

310 likes

Total Posts

1,131 posts

Correct Reply

184 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

04-05-2021

@Ryano_DE Let's discuss on '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?'

The somexpression for the repeatable panel/rows is driven by the main panel or row. You should be able to construct a somexpression for all the rows something like we do in array or  JSON with child nodes.

Answers (2)

Answers (2)

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

310 likes

Total Posts

1,131 posts

Correct Reply

184 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

310 likes

Total Posts

1,131 posts

Correct Reply

184 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

23-04-2021

@Ryano_DE  I like your magic all intention :). But to be true I really didn't get what Is the objective here? 

From the API DOC "There is no link between Dom ready events and the connect API. If one wants to access the HTML DOM from inside the connect callback, the recommended approach is to listen on the jQuery ready event or the native DOMContentLoaded event. Similarly if one wants to access GuideBridge APIs one needs to wait for the connect callback to get fired."

Avatar

Avatar
Ignite 1
Level 7
GirishBedekar
Level 7

Likes

163 likes

Total Posts

233 posts

Correct Reply

36 solutions
Top badges earned
Ignite 1
Give Back 5
Give Back 3
Give Back 10
Give Back
View profile

Avatar
Ignite 1
Level 7
GirishBedekar
Level 7

Likes

163 likes

Total Posts

233 posts

Correct Reply

36 solutions
Top badges earned
Ignite 1
Give Back 5
Give Back 3
Give Back 10
Give Back
View profile
GirishBedekar
Level 7

21-04-2021

Can you please give us more details in the use case?