Copy link to clipboard
Copied
I'm trying to display a different page 2 based upon checkbox selection and I have the below function at the document level, which is called upon for each checkbox and it hides and shows the template beautifully. However, the template appears at the end of the document (page 3 of 3) and I would like for it to always display as page 2 forcing the previous page 2 to the new page 3. Can I accomplish this without spawning?
var narr1 = this.getField("1E-F1_NARRATIVE").value;
var narr2 = this.getField("1E-F2_NARRATIVE").value;
var narr3 = this.getField("1E-F3_NARRATIVE").value;
if (narr1 == "Off" && narr2 == "Off" && narr3 == "Off") {
this.getTemplate("Narrative").hidden=true;
} else {
this.getTemplate("Narrative").hidden=false;
}
}
You can use the movePage command after un-hiding the Template page to move it to the desired location.
PS. Why all the colors? it makes it quite difficult to read the code (to me, at least).
Copy link to clipboard
Copied
You can use the movePage command after un-hiding the Template page to move it to the desired location.
PS. Why all the colors? it makes it quite difficult to read the code (to me, at least).
Copy link to clipboard
Copied
Apologies, I pasted out of a dark themed code editor. That did the trick - thank you so much!
var narr1 = this.getField("1E-F1_NARRATIVE").value;
var narr2 = this.getField("1E-F2_NARRATIVE").value;
var narr3 = this.getField("1E-F3_NARRATIVE").value;
if (narr1 == "Off" && narr2 == "Off" && narr3 == "Off") {
this.getTemplate("Narrative").hidden=true;
} else {
this.getTemplate("Narrative").hidden=false;
this.movePage(1);
}
}