Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.declarativeforms.com/llms.txt

Use this file to discover all available pages before exploring further.

If you have not created a form before, start with Create a form.
form.yaml
version: 1
title: "Example form"
description: "A comprehensive number example."

sections:
  - id: section_1
    title: "Section 1"
    fields:
      - id: question_1
        type: number
        label: "Question 1"
        placeholder: "10"
        validators:
          - required
          # If you omit a custom pattern, the runtime adds whole-number validation automatically.
          - type: pattern
            regex: "^\\d+$"
            message: "Use whole numbers only."
          - type: min
            value: 1
            message: "Use a number greater than or equal to 1."
          - type: max
            value: 100
            message: "Use a number less than or equal to 100."
          - type: expression
            expression: "data.question_1 % 5 === 0"
            message: "Use a number divisible by 5."

    next: done