I have a form with two hidden subforms. Each subform contains a table with fields that need to be mandatory when visible.
The subforms are hidden or revealed based on a selection from a drop-down list.
I found the below script which works great for making a text field mandatory when visible, but, how do you apply this to cells in a table?
I can't figure it out.
if ("RMC-Fort Lupton-FIRE-DOT" == xfa.event.newText)
Table.FL.presence = "visible";
Table.FL.presence = "hidden";
if ("RMC-Ault-FIRE-DOT" == xfa.event.newText)
Table.ALT.presence = "visible";
Table.ALT.presence = "hidden";
Thanks in advance!
I applied this in a blank new form and it worked fine:
form1.page1.Table1.Row1.Cell1.mandatory = "error";
Thanks for responding Diego,
I tried it and it works fine, but, what if the table has 27 rows and two mandatory cells in each row?
Is there someway to combine them into one line of script? To do them individually will require 54 lines of script just for one table, assuming one line of script for each mandatory cell. The form I creating will eventually have four hidden tables, each with a similar number of rows.
You can use bit of scripting to count the no.of rows and according to that you can loop through them. But before that you need to check the table structure. Can you show the table structure?
Thanks for responding.
Here is the table structure. Rows 1 through 25 are all the same. Each row has two cells with Radio Buttons named "AsFound" and "AsLeft." Both need to be mandatory when visible. If you need more information, let me know.