Skip to main content
Participating Frequently
February 2, 2016
Question

Please Help...npage function with Template

  • February 2, 2016
  • 1 reply
  • 924 views

I am currently creating a pdf form for work in adobe acrobat pro XI and I've been able to work out every issue with the exception of this.

I have a page with a checkbox (labeled checkbox) at the bottom page of page 2.  I have also created a template (labeled Quote2). When the check box is checked/unchecked it shows and hides the template (Quote2) no problem. However, it shows and hides the template at the bottom of the entire pdf. I've been trying to find as much information on npage functions, however I only seem to find npage information related to spawn. I can't or do not want to use a spawn template function because the field names change and the javascript and calculations that I've written for that original template(Quote2) does not update to match those field name changes and the calculations no longer function.

I would like to just to un-hide the template after the page the checkbox is located on, specifically page 3.

Here is the script for the checkbox that I have written already:

//this allows me to show

var t = this.getTemplate("Quote2");

t.hidden = event.target.value === "Off"

Please note, I am fairly new to scripting, so lower - mid level responses are appreciated. lol

Any help is appreciated! Thank you!

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
February 2, 2016

So what happens when you run the code? Are there any error messages in the JS console? Also, where did you place it, exactly?

And are you aware it's not going to work in Reader, only in Acrobat?

Participating Frequently
February 2, 2016

The code I've pasted above works fine, to unhide the template when checked and hide the template when unchecked. The only issue I have is that it hides/unhides the template at the very last page of the entire pdf.

I wanted to show/hide the template page in a specific location. Specifically, the very next page after the checkbox.

Also, I am aware it wont work in Reader. Its an internal document and there will only be 4 individuals using this who also have acrobat pro.

try67
Community Expert
Community Expert
February 2, 2016

You can use the movePage method to move it back to where it should be.

On Tue, Feb 2, 2016 at 6:32 PM, nicoleanne26 <forums_noreply@adobe.com>