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

Checkboxes not working on a spawned page

Community Beginner ,
Apr 26, 2022 Apr 26, 2022

Copy link to clipboard

Copied

Here is my code for the spawned page

var SpawnPage = this.getTemplate({cName: "table"});
  SpawnPage.spawn({nPage: this.numPages, bRename: true, bOverlay: false});
    this.getField("P" + (this.numPages - 1) + ".table.Name").setFocus();

The code for the checkbox looks like this:

var nDisplay = event.target.isBoxChecked(0) ? display.visible : display.hidden;
this.getField("P" + (this.numPages - 1) + ".table.Dropdown39").display = nDisplay;
this.getField("P" + (this.numPages - 1) + ".table.Text40").display = nDisplay;
this.getField("P" + (this.numPages - 1) + ".table.Text41").display = nDisplay;

Unfortunatelly it doesn't work. I have no idea how I should link the checkbox to the correct element on the spawned page...

TOPICS
PDF forms

Views

1.1K

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

Community Expert , Apr 27, 2022 Apr 27, 2022

Then use event.target.page instead of this.numPages-1. For example:

 

this.getField("P" + (event.target.page) + ".table.Text41").display = nDisplay;

Votes

Translate

Translate
Community Expert ,
Apr 26, 2022 Apr 26, 2022

Copy link to clipboard

Copied

Check the Javascript console for errors.

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 Beginner ,
Apr 26, 2022 Apr 26, 2022

Copy link to clipboard

Copied

I thought that maybe it has to do something with this line: 

this.getField("P" + (this.numPages - 1) + ".table.Text41").display = nDisplay;

I guess that it points everytime on the element that is spawned. In that case if I have this element at the top of every spawned page and it is named P4.table.Text41, P5.table.Text41, P6.table.Text41, etc. if I check one checkbox, that top element on every spawned page is checked. How to avoid this?

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 ,
Apr 26, 2022 Apr 26, 2022

Copy link to clipboard

Copied

Is the purpose of the check-box to show/hide fields on the same page as it is, or on another page?

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 Beginner ,
Apr 26, 2022 Apr 26, 2022

Copy link to clipboard

Copied

On the same page.

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 ,
Apr 27, 2022 Apr 27, 2022

Copy link to clipboard

Copied

Then use event.target.page instead of this.numPages-1. For example:

 

this.getField("P" + (event.target.page) + ".table.Text41").display = nDisplay;

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 Beginner ,
Apr 28, 2022 Apr 28, 2022

Copy link to clipboard

Copied

Hey, I have missed your response somehow. It works just fine. 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
Community Expert ,
Apr 27, 2022 Apr 27, 2022

Copy link to clipboard

Copied

Can you share the form?

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 Beginner ,
Apr 28, 2022 Apr 28, 2022

Copy link to clipboard

Copied

Plese find a form attached. I have deleted all not needed information and left only the objects that are causing the problem.

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 Beginner ,
Apr 28, 2022 Apr 28, 2022

Copy link to clipboard

Copied

PS. ON/OFF button is for the purpose when checkbox won't be working. In that case I would have to leave the buttons then, but I would really like to have the checkboxes working instead of those buttons.

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 ,
Apr 28, 2022 Apr 28, 2022

Copy link to clipboard

Copied

You didn't apply the changes I specified.

Also, you should hide the Template page and manually spawn one copy from it, so that it works there, too.

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 Beginner ,
Apr 28, 2022 Apr 28, 2022

Copy link to clipboard

Copied

You are right ; ) I have missed your response. Everything works now. Thank you for your help.

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 Beginner ,
Apr 28, 2022 Apr 28, 2022

Copy link to clipboard

Copied

I have noticed strange behavior. The checkbox works but only after third spawned page. At first two spawned pages it doesnt work but third page is already functional and every page after third also works. I have the latest version of Adobe Reader...

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 ,
Apr 28, 2022 Apr 28, 2022

Copy link to clipboard

Copied

Did you do as I advised?

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 Beginner ,
Apr 28, 2022 Apr 28, 2022

Copy link to clipboard

Copied

LATEST

 I had to use for this form Foxit and it has some bugs and when I save the form with hidden templates they dissapear. I am waiting for an update to solve this issue. Anyway, in the Adobe Reader the problem is like I said. After third spawned page the checkboxes works.

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