Expand my Community achievements bar.

Create link to another part of the form

Avatar

Former Community Member
Hi all,



I have created a dynamic form that contains two work plans. Users will fill out one or the other, but not both. I want to provide links to the beginning of each work plan. I cannot reference specific page numbers as the form is dynamic and the page count will change as the form is filled in. What is the code I need to use to do this. I assume I have to reference specific form objects, such as the tables housing the work plans, but I'm not sure what code I need to use.



Thank you in advance.



Jennifer
2 Replies

Avatar

Former Community Member
Jennifer, I use a Button object. First, add a field on the page you want to go to. At the beginning of the work plan add a Button using this JavaScript on the Click Event:



xfa.host.setFocus("Page1.SubformName.TextField");



(change your subform/field names as needed). The field can be visible or hidden. When you click on the button, your cursor will jump to that spot. I use this function to jump through multiple page documents.

Avatar

Former Community Member
Is that also possible for subform instances?

I tried this code:

xfa.host.setFocus("Page.Form.resolveNode("Subform[" + i.toString() + "].Textfield")");

But this code crashes directly. What was my mistake?