Expand my Community achievements bar.

SOLVED

Delete row 1 buttons on repeatable tables

Avatar

Level 9

I have a button in Row1 of a repeating table that adds additional rows. I want to be able to hide all of these buttons by clicking another button located at the bottom of the form. Can you tell me how to script to count the table instances and then set the presence of each button to be "invisible"?

This is my script that does not work:

var vRows = Table1.instanceManager.count;

for (i=vRows;i>0;i--){

xfa.resolveNode("Table1[" + i + "]").Row1.button1.presence = "invisible";

}

1 Accepted Solution

Avatar

Correct answer by
Level 9

I was able to solve this myself. The script that works is:

var nRows = xfa.resolveNodes("Table1[*].Row1[*]");

for (var i=0; i<nRows.length; i++)

{

nRows.item(i).Subform13.AddQuestionButton.presence = "invisible";

nRows.item(i).Subform13.DeleteLastQuestionButton.presence = "invisible";

}

View solution in original post

1 Reply

Avatar

Correct answer by
Level 9

I was able to solve this myself. The script that works is:

var nRows = xfa.resolveNodes("Table1[*].Row1[*]");

for (var i=0; i<nRows.length; i++)

{

nRows.item(i).Subform13.AddQuestionButton.presence = "invisible";

nRows.item(i).Subform13.DeleteLastQuestionButton.presence = "invisible";

}