Expand my Community achievements bar.

referencing rows within a table

Avatar

Level 2

Hi all,

I don't know if this has been brought up before, and believe me I have looked, but here goes...  I have a table with many tens of rows.  Cell 1 of those rows is a checkbox with the exit event scripted as (formcalc)

if

(this.rawValue == "1") then

form1.Main_Subform.GeneralTable.Row1.presence

= "visible"

else

form1.Main_Subform.GeneralTable.Row1.presence = "hidden"

endif

What I want to do is not have to put the above script in each event of each checkbox.  So is there a way of referencing all the checkboxes at once and having the same result of making the associated row go hidden if not checked?

Also, I have a reset button for the form that I want to be able to reset all row presences to visible when clicked.  I should mention here that the form has several tables all with checkboxes in cell one and all with add buttons that addInstances at the bottom of the tables that I do not want reset with the reset button.  In short, the tables list controlled documents that need to be reviewed annually and that because of the sheer volume of them will need to be parsed out, and the parsing may or may not be entire tables and the tables need to be able to be added to.  Here is what I have regarding the reset of the presences of the rows (I have only just begun):

xfa.host.resetData();

form1.Main_Subform.GeneralTable.Row1.presence

= "visible";

form1.Main_Subform.GeneralTable.Row2.presence

= "visible";

form1.Main_Subform.GeneralTable.Row3.presence

= "visible";

form1.Main_Subform.GeneralTable.Row4.presence

= "visible";

So my question regarding the reset button is...  Is there a way of resetting the presences of all rows within either all tables or each table without listing each and every row individually within the click event of the reset button?

Thank you all in advance.  -rpeterson

1 Reply

Avatar

Level 6

Hi,

You can add one more button to your form. On click event of this button you can put script, which will loop througth all rows of your table and check checkbox, if it will be checked then hide is bot - leas as it is.

If you want to hide row after click on checkbox, you have to put scripts to each of it.

BR,

Paul Butenko