Validating subform rows that are never opened.
I'm using a summary columns style subform for an expenses app. When the edit window opens, the required fields validation works exactly as I want it, forcing people to fill out the fields before they OK their changes.
However, those validation rules aren't applied if people just submit from the main form, presumably because the validation only applies to visible items.
Is there a way to require fields on summary column style subforms even when they're not visible on the main form?
To make it even more complicated, some of those fields can be hidden on the subform, in which case the validation should be ignored.
Thanks,
Karl
-
The way that AgilePoint Forms code runs is that hidden fields are globally disabled. A field must be shown in order to apply properties such as mandatory or validation. I would add code to manually validate and submit the form instead of using the default buttons in this scenario unless someone else figured out a way using rules.
-
Thanks, Karl... I found I can grab all the subform data via eFormHelper.getSubFormData, so I used that in conjunction with a trick someone else here had found in trying to validate subforms: I run my custom validation JS on the 'before validation' event, and then set a single field with the result. I then use that field in the validation event to block submission if needed.
Please sign in to leave a comment.
Comments
2 comments