Show/Hide Template while simultaneously adding new page content...

New Here ,
Jul 13, 2022 Jul 13, 2022

Copy link to clipboard

Copied

I've been beating my head against the wall on this for a week after believing I'd cracked the code... either stupidity, naivete, or a combination of both.

The examples in the varying threads here have been unblievably helpful.  I'm able to show/hide page overlays & fields and to add/delete templates as additional pages.  My headache has become combining the two.

I've created a consistent header containing information that is always required -- it accounts for approximately the top 1/4 of the page.  I've added a radial selection button that will show or hide the content underneath this first page header.  Unfortunately, one of the forms requires additional pages -- which, thanks to the experts in these discussion threads, I can automate by spawning from templates.  Where I'm failing miserably is maintaining the original header and entered data across the spawned pages.

My sincerest thanks in advance for any and all assistance.

Very Respectfully,

Charlie

TOPICS
How to , JavaScript , PDF forms

Views

30

Likes

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
Adobe Community Professional ,
Jul 14, 2022 Jul 14, 2022

Copy link to clipboard

Copied

 Where I'm failing miserably is maintaining the original header and entered data across the spawned pages.

 

Can you explain this issue?

Likes

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
New Here ,
Jul 14, 2022 Jul 14, 2022

Copy link to clipboard

Copied

LATEST

While there are most likely more efficient ways to accomplish this, I created a primary page that consists of the header -- the contents under the header change based on a radio button or pulldown selection.  Then, utilizing the same fields on the primary page on the spawned templates the data is autofilled (as the field on the primary was filled out).  That being said, there is, at time, a noticible lag before the common fields on the spawned pages auto-populate.  At least that's how it's been working on my end.

And I finally figured out the issue I posted above with:

;if (this.numPages >1){this.deletePages({ nStart: 1, nEnd: this.numPages -1}) };this.getTemplate("ROS PG2").spawn();this.getTemplate("ROS PG3").spawn();

My original deletePages //this.deletePages({nStart: 2, nEnd: 3});// was causing the entire issue.  As there weren't pages to delete on the opening of the form the script would stop and not spawn the pages.  I was forced to figure out an "if" statement which now works irrespective of the number of initial pages (trying to stick with only 1) on document opening.

Likes

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