Issue with code -- button to hide a different button that adds instances of a subform

Avatar

Avatar

akgrimes

Avatar

akgrimes

akgrimes

23-01-2018

Dynamic LiveCycle Designer form. Throughout the form there are tables where users can click a button to add another line or remove the current line. When the form is complete, I have a button set to "hide" various items throughout the form (help text, save buttons, etc.) to clean it up for the final version. I also have a button set to redisplay all those items, in case we need to go back and change anything. The first "hide" button also displays one more button, and this button disables all the scripts for the fields throughout the form, so nothing can be changed.

I would like the "hide" button to also hide the buttons on the tables to add/remove rows throughout the form. I can get the "hide" button to hide the first instance of the add/remove buttons ... but if the user uses the add button to add a row, the add/remove buttons on that row isn't hidden.

I've done a ton of searches, and I feel like I'm close on my code, but I'm not writing it correctly. Can you tell what I have out of place? Thanks!

form1

      pageonesubform

            tablesubform

                  table

                        headerrow

                        repeatrow

                              addremovesubform

                                    addbutton

                                    removebutton

var nodes = xfa.resolveNodes("form1.pageonesubform [*].addremovesubform[*]");

var len = button.length;

for(var i=0; i<len; i++){

  1. button.item(i).addbutton.presence = "invisible";

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar

akgrimes

Avatar

akgrimes

akgrimes

23-01-2018

For some reason my cut and paste made that last row a bullet -- this is the code I'm trying:

var nodes = xfa.resolveNodes("form1.pageonesubform [*].addremovesubform[*]");

var len = button.length;

for(var i=0; i<len; i++){

button.item(i).addbutton.presence = "invisible";