In my attached form I collect info and then at the bottom I have a button to add the next disclosure, this creates a new subform on the next page. I would like (if possible) to be able to automatically move to the top of the next page when the "Next Disclosure" button is clicked. Is this possible?
Thanks for the help.
Views
Replies
Total Likes
Select the page1 form and on the properties -> pagination -> place select "on top of page 1"
Views
Replies
Total Likes
That did not work. The next page is added but I still have to scroll to see it. Is there a way to have the next page automatically scrolled into position without the user having to scroll down to see it?
Views
Replies
Total Likes
Yes, you can use the setFocus (on the new instance) method after you add the new instance to the form.
Views
Replies
Total Likes
Can you give me an example of using setFocus? I tried xfa.host.setFocus("CompanyName") and that puts the focus on the first page not the next page. When I changed it to ..("CompanyName[1]") that didn't work.
Thanks again for the help.
Views
Replies
Total Likes
This has worked for me:
// jump to next page
xfa.host.pageDown();
//optional - alert the user
app.alert("You have jumped to the newly added Treatment page")
Views
Replies
Total Likes
I use a similar command and it work.
xfa.host.setFocus(xfa.resolveNode("CompanyName["+(CompanyName.instanceManager.count-1)+"].CHOOSE_A_FIELD_TO_SET_FOCUS"));
I haven't tested this on your form, but it should work. Just one not, your javascript must run on client.
Views
Replies
Total Likes
The setFocus command is the command to use but your objects do not exist until the script is finished. The only way I have found to do this is by using an Acroform command to execute another command in the future.
Here is the command:
Paul
Views
Replies
Total Likes
Paul,
If you put the setFocus command on the Initialize event of the object (the one thats added) woun't it only be invoked after the creation of the object is finished?
Views
Replies
Total Likes
Thank you guys for the wonderful tips but I'm just not getting it to work. Can you post an example that works so that I can see what I'm supposed to do?
Jay
Views
Replies
Total Likes
See if it helps.
Rui,
That worked, thank you so much! Thanks to Paul and malaki as well. I'm posting the form if anyone else wants to see the code, it's under the "Next Disclosure" button.
Thanks again!
Jay
Views
Replies
Total Likes
Views
Likes
Replies