Leiste mit Community-Erfolgen erweitern.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
GELÖST

Add/Remove buttons not working properly on hidden Subforms

Avatar

Level 2

I have this pdf form (attached) that has hidden subforms that appear when certain boxes are checked. I'm having issues with my Section C. subforms. I have add/remove row buttons, plus buttons that allow the user to rearrange the data within. As long as the subform is set to Visible, the add/remove buttons work. When it is hidden, the add row button does nothing and the remove row button will take away the only row visible (and it shouldn't do that).

 

I'm hoping someone can tell me what where I went wrong?

 

To make it easier for you: 

If you answer "No" to the first question in Section B, Section C2 will appear. 

Mav_S_0-1733946723740.png

 

 

If you check "a PMA based on Test and Computation" in Section A and answer "No" to the first question in Section B, Section C3 will appear. 

Mav_S_1-1733946723741.png

 

Mav_S_2-1733946723742.png

 

 

C2 and C3 are my hidden trouble makers. 

 

TYIA!

Themen

Anhand von Themen werden Community-Inhalte kategorisiert und Sie können so relevanten Inhalt besser finden.

1 Akzeptierte Lösung

Avatar

Korrekte Antwort von
Level 10

Replace the script in the Add button: This can't work because it's starts with "this", so the resolveNode() method starts searching a node relative to the buttons position in the node tree. But there's no object "page1" in its direct neighborhood, so nothing happens, when you click it. 

this.resolveNode('page1._SectionC3').addInstance(1);
if (xfa.host.version < 😎 {
	xfa.form.recalculate(1);
}

 

Use this instead:

_SectionC3.addInstance(1);

 

Lösung in ursprünglichem Beitrag anzeigen

6 Antworten

Avatar

Level 10

Where are those add/remove buttons located? I don't see a problem with the ones in C1 and D1.

Avatar

Level 2

There are no problems with C1 and D1, because they are visible.

 

The issue is in the hidden subforms.

 

To get to C2 you have to check "No" to the first question in Section B. 

 

To get to C3, you have to check "a PMA based on Test and Computation" in Section A; then check "No" to the first question in Section B. 

 

Also, both C2 and C3 will work properly if I set them to "Visible". Which makes me believe it has to do with something in how hidden things work.

Avatar

Korrekte Antwort von
Level 10

Replace the script in the Add button: This can't work because it's starts with "this", so the resolveNode() method starts searching a node relative to the buttons position in the node tree. But there's no object "page1" in its direct neighborhood, so nothing happens, when you click it. 

this.resolveNode('page1._SectionC3').addInstance(1);
if (xfa.host.version < 😎 {
	xfa.form.recalculate(1);
}

 

Use this instead:

_SectionC3.addInstance(1);

 

Avatar

Level 2

I changed my script to what you suggested and it didn't do anything different. 😞 

Avatar

Level 10

This absolutely works. You may have done something wrong.
Here's the scripts for the add/delete buttons of C3 for example. Works for me.

radzmar_0-1734627309472.png

 

Avatar

Moderator

@Mav_S is the issue resolved?