Highlighted

Need to a way to update JavaScript on spawned page

New Here ,
Oct 21, 2020

Copy link to clipboard

Copied

I have a document where page 3 has a text field that makes other fields on that page required when it is filled. I have been able to make that page a template and have been able to spawn a page right after the original page but the fuctionality of making certain fields required after a text box is filled in is gone on the spawned page. I assume this is because the spawned page has fields that are renamed. I have also looked into just making the template visible but that adds the template to the end and not after page 3. 

To recap I am trying to:

Make a particular text field on the spawned page make other fields on the same spawned page required. 

New page must appear right after the original page (original page is 3rd of 8)

Can anyone help?

TOPICS
How to, PDF forms

Views

17

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

Need to a way to update JavaScript on spawned page

New Here ,
Oct 21, 2020

Copy link to clipboard

Copied

I have a document where page 3 has a text field that makes other fields on that page required when it is filled. I have been able to make that page a template and have been able to spawn a page right after the original page but the fuctionality of making certain fields required after a text box is filled in is gone on the spawned page. I assume this is because the spawned page has fields that are renamed. I have also looked into just making the template visible but that adds the template to the end and not after page 3. 

To recap I am trying to:

Make a particular text field on the spawned page make other fields on the same spawned page required. 

New page must appear right after the original page (original page is 3rd of 8)

Can anyone help?

TOPICS
How to, PDF forms

Views

18

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
Oct 21, 2020 0
Adobe Community Professional ,
Oct 21, 2020

Copy link to clipboard

Copied

Is this script on a field, on the page that is spawned?  This is critical. 

All the script needs to do is create names of the affected fields from the  prefix of the name on the current field. 

Template Field naming is predictable. "P#.<template name>.<base field name>".

 

Extract the prefix and then add it to the name of the fields on the page.

// default to empty

var cPrefix = "";

if(/(P\d{1,2}\.MyTemplate\.)/.test(event.targetName))

    cPrefix = RegExp.$1;

 

this.getField(cPrefix + "MyField").required = true;

...etc...

 

This script will work with both the unspawed template page and the spawned page.

 

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
Reply
Loading...
Oct 21, 2020 0