How can I check for required fields in an expanding table? In my current setup, it only checks the first row to make sure it's filled out, but then allows the remainder to be empty when locking the form. Setting the two fields (Full Legal Name and Position Type) to "Required" doesn't do the trick, because I need all of the following to take place. I can't simply lock all fields in the form either, because there are a couple of others and a signature field that should not be locked. There are other fields in the form that I'm not showing here; that part of my form is working okay.
The submitter can click the "plus" and "minus" buttons in the row to add and remove spaces for additional names.
My script does the following:
Check for all fields required from submitter. If a field is blank, cancel submit.
Confirm permission to lock all submitter input fields. (If submitter clicks "No", then abort and allow submitter to continue entering data. If "Yes", continue.)
Submit file via e-mail
if (UsersRequiringAccess.Table1.RowUserName.FullLegalName.rawValue == null ||
I can't send you the form because it's an internal government form. But please tell me what the issue is. I have since adopted a different method of handling this situation -- I simply make the fields in the new row required and the general form validation handles any empty field errors upon submitting. If you need to hide/show the table dynamically or make the fields required/not required dynamically, you have to add some scripting to make the fields in the new row mandatory. For some reason, if the fields are originally set as optional and you make them mandatory via scripting before adding another row, the fields in the new row are still optional.
If you click on the first screenshot above, you can see the "add row" (plus sign) button, which has this script:
// add row
// make fields in new row required
var lastRow = Table1.resolveNode("RowUserName[" + (Table1._RowUserName.count - 1) + "]");