Skip to main content

Form-Level Validation

Form-level validation involves rules that span multiple components or apply to the form as a whole. These validations help ensure data consistency and integrity across the entire form.

Common Form-Level Validations

  • Conditional Validation: Make fields required based on other field values
  • Cross-Field Validation: Compare values between different fields
  • Unique Value Validation: Ensure certain fields have unique values across submissions

Conditional Validation

Conditional validation makes a field required or applies other validation rules based on the values of other fields. For example:

  • Making an "Other" text field required when "Other" is selected in a dropdown
  • Requiring additional details when a certain option is chosen
  • Applying different validation rules based on the form context

To configure conditional validation:

  1. Select the component on the canvas
  2. Navigate to the Validation tab in the settings panel
  3. Enable the "Conditional Validation" option
  4. Set up the condition using the visual condition builder:
    • Select the field to base the condition on
    • Choose the operator (equals, not equals, contains, etc.)
    • Specify the value to compare against
  5. Configure the validation rule to apply when the condition is met
  6. Customize the error message

Cross-Field Validation

Cross-field validation compares values between different fields to ensure consistency. Common examples include:

  • Ensuring a "Confirm Password" field matches the "Password" field
  • Verifying that an end date is after a start date
  • Checking that a maximum value is greater than a minimum value

To configure cross-field validation:

  1. Select the component on the canvas
  2. Navigate to the Validation tab in the settings panel
  3. Enable the "Cross-Field Validation" option
  4. Select the field to compare with
  5. Choose the comparison operator (equals, not equals, greater than, etc.)
  6. Customize the error message

Unique Value Validation

Unique value validation ensures that certain fields have unique values across all submissions. This is useful for fields like:

  • User IDs
  • Serial numbers
  • Registration codes
  • Email addresses (when used as identifiers)

To configure unique value validation:

  1. Select the component on the canvas
  2. Navigate to the Validation tab in the settings panel
  3. Enable the "Unique" option
  4. Customize the error message

When a user attempts to submit a form with a value that already exists in a previous submission, an error message will be displayed.

Custom JavaScript Validation

For advanced validation needs, you can use custom JavaScript to implement complex validation logic:

  1. Select the component on the canvas
  2. Navigate to the Validation tab in the settings panel
  3. Enable the "Custom Validation" option
  4. Enter JavaScript code that returns true (valid) or false (invalid)
  5. Customize the error message

Custom JavaScript validation provides the most flexibility for implementing complex validation rules that cannot be achieved with the standard validation options.