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 file_upload example."

sections:
  - id: section_1
    title: "Section 1"
    fields:
      - id: question_1
        type: file_upload
        label: "Question 1"
        placeholder: "Upload one or more files"
        accepted_mime_types:
          - application/pdf
          - image/png
          - image/jpeg
        validators:
          - required
          - type: min
            value: 1
            message: "Upload at least 1 file."
          - type: max
            value: 3
            message: "Upload no more than 3 files."
          - type: expression
            expression: "(data.question_1 || []).length <= 3"
            message: "Upload no more than 3 files."

    next: done
Use accepted_mime_types to limit uploads to specific MIME types. For example, application/pdf only allows PDFs, while image/* allows any image type the browser reports with an image MIME type.