How Required Field Validation Works
Joyfill automatically validates required fields based on:- Field requirement: Fields marked as required = true
- Field visibility: Hidden fields are always filtered out of the validation output
- Field values: Required fields must have non-empty values to be valid
validate(path:))
Use a path string when you only need validation for the whole document, one page, or one field layout—same rules as validate(), scoped to that path.
""(or whitespace-only) — same asvalidate(); result is.page(Validation).- Page id only — pass a single page id string; fields on that page only;
.page(Validation). pageId/fieldPositionId— two ids separated by/; that field when the first segment matches the page that owns the position;.field(FieldValidity). Otherwise falls back to.page(Validation)for the page id in the path.
/ is ignored. Use fieldValidity on the returned ComponentValidity when you only care about the single-field case (non-nil for .field).
- Call validate() before form submission
- Check status for overall validation result
- Use fieldValidities to get specific field errors
- Required fields must have non-empty values
- Hidden fields are always filtered out of the validation output (conditional logic and
hiddenViews) - Page hidden: all of its fields are valid
- Table/Collection: validate their required columns per row. Each
FieldValidityincludesrowValiditieswith row-level and cell-level results (RowValidityandCellValidity) - Non-required table/collection fields still validate rows against required columns
- Navigate to invalid fields: use
fieldValidity.pageIdandfieldValidity.fieldPositionIdwithgoto()to navigate directly to invalid fields - Path-scoped checks: use
validate(path:)when you validate after a single edit, one page submit, or to match the samepageId/fieldPositionIdshape asgoto()