Skip to main content
The validation system checks required fields, validates data formats, and provides detailed feedback about validation status.

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 considered valid (even if required)
  • Field values: Required fields must have non-empty values to be valid
Basic Usage
let documentEditor = DocumentEditor(document: document)

// Validate all fields
let validationResult = documentEditor.validate()

if validationResult.status == .valid {
    print("Form is complete and valid")
    // Proceed with submission
} else {
    print("Form has validation errors")
    // Show errors to user
}
Key Points
  • 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 automatically considered valid
  • Page hidden: all of its fields are valid
  • Table validate their required columns