• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to find and reference field name on spawned page

Explorer ,
Nov 27, 2020 Nov 27, 2020

Copy link to clipboard

Copied

I've been trying to find some information on how to specifically reference a field name on a spawned page. My goal is to have my "spawn button" only displayed on the last page of the document at all times. I have currently have a hidden button on my spawn template, but would like to find a way to make it visible only on the last page (which is a spawned page).

 

I've been playing around with this tutorial but can't figure out how to make it work for my purposes: https://wordwizardsinc.com/blog/finding-the-fieldname-prefix-on-acrobat-acroform-spawned-template-pa... 

 

Thank you!

TOPICS
Acrobat SDK and JavaScript

Views

753

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Nov 27, 2020 Nov 27, 2020

Marking this as resolved, I was able to figure it out.

Votes

Translate

Translate
Community Expert ,
Nov 27, 2020 Nov 27, 2020

Copy link to clipboard

Copied

Can you find the button?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 27, 2020 Nov 27, 2020

Copy link to clipboard

Copied

Hi Bernd, I'm not sure I understand the question completely, but I am able to make the button visible and hide it again on the page that it exists on (the template). I'd like to be able to make it visible only the last spawned page though, and am unable to derive the field name for the spawned page so it pops up only on that page. 

 

Thanks again!

Bev

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 27, 2020 Nov 27, 2020

Copy link to clipboard

Copied

Does you spawn the pages with the rename option?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 27, 2020 Nov 27, 2020

Copy link to clipboard

Copied

yes, they're all being renamed as each form should contain unique information (no duplicates or overwriting)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 27, 2020 Nov 27, 2020

Copy link to clipboard

Copied

So I played around some more and was able to get it to spawn on the last page using this code:

 

this.getField("P" + (this.numPages - 2) + ".Template1" + ".Button 1").display=display.visible; this.pageNum=this.numpages-1;

 

However when I spawn a new page it just stays on that page, and the newly spawned page does not display the button. My intent is to have the button "move" to always only stay on the last page. 

 

My reason for this is to control how the pages get spawned, because if the button is on all pages, and a person spawns from an earlier page, it eventually makes the page numbering wonky and duplicates start to pop up. 

 

Hopefully this all makes sense!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 27, 2020 Nov 27, 2020

Copy link to clipboard

Copied

So I played around some more and was able to get it to spawn on the last page using this code:

 

this.getField("P" + (this.numPages - 2) + ".Template1" + ".Button 1").display=display.visible; this.pageNum=this.numpages-2;

 

However when I spawn a new page it just stays on that page, and the newly spawned page does not display the button. My intent is to have the button "move" to always only stay on the last page. 

 

My reason for this is to control how the pages get spawned, because if the button is on all pages, and a person spawns from an earlier page, it eventually makes the page numbering wonky and duplicates start to pop up. 

 

Hopefully this all makes sense!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 27, 2020 Nov 27, 2020

Copy link to clipboard

Copied

Marking this as resolved, I was able to figure it out.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 27, 2020 Nov 27, 2020

Copy link to clipboard

Copied

LATEST

Please explain what you figured out as it may help other users in the future.

Thank you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines