Skip to content

Form Template Element - Multi Line Text Entry

Functional Behavior

A multi line plain text entry field. Line breaks, and special characters are allowed. Special formatted markup, such as Markdown are not allowed.

Visual Representation

A Text entry box that allows multiple lines of plain text up to the maximum number of allowed characters.

Parent Elements

The Multi Line Text Entry form element, can appear as a child of:

Definition

Definition: Multi Line Text Entry
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {
    "multiLineTextEntry": {
      "contentMediaType": "text/plain",
      "pattern": "^[\\S\\s]*$",
      "type": "string"
    }
  }
}

Parameters

The Multi Line Text Entry form element takes the following parameters:

Multi Line Text Entry
Parameters
default
The default value to be used if the field is empty. Takes priority over x-placeholder if both are defined.
Required optional
Type string
Example default: "This explanation has not been given.\nIgnore it."
description
The description of the field presented to the user during data entry.
Required optional
Type string
Content Media Type text/markdown; template=handlebars
Example description: "Explain what it is you want to achieve."
maxLength
Maximum number of characters allowed in the field.
Required yes
Type integer
Example maxLength: 5000
minLength
Minimum number of characters allowed in the field.
Required optional
Type integer
Example minLength: 20
title
The label attached to the field.
Required yes
Type string
Content Media Type text/plain
Example title: "Explanation"
x-guidance
Long form Markdown formatted description to give guidance about how the field is to be completed.
Required optional
Type string
Content Media Type text/markdown; template=handlebars
Example x-guidance: "It's useful to explain things here."
x-icon
The name of the Icon to display with the field.
Required optional
Type string
Choices Icons
Example x-icon: "academic-cap"
x-placeholder
Placeholder text to display inside the field if it is empty. Unlike default it does not provide a default value for the field.
Required optional
Type string
Example x-placeholder: "What's your explanation?"

Example Usage

This is an Example Form Template showing just the Multi Line Text Entry form element, and its parents.

Example:
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "multiLineTextEntry Example",
  "description": "An example of the multiLineTextEntry Element, and it's parents.",
  "$defs": {
    "multiLineTextEntry": {
      "contentMediaType": "text/plain",
      "pattern": "^[\\S\\s]*$",
      "type": "string"
    },
    "section": {
      "additionalProperties": false,
      "type": "object"
    }
  },
  "type": "object",
  "properties": {
    "exampleSection": {
      "$ref": "#/$defs/section",
      "properties": {
        "exampleMultiLineTextEntry": {
          "$ref": "#/$defs/multiLineTextEntry",
          "default": "This explanation has not been given.\nIgnore it.",
          "description": "Explain what it is you want to achieve.",
          "maxLength": 5000,
          "minLength": 20,
          "title": "Explanation",
          "x-guidance": "It's useful to explain things here.",
          "x-icon": "academic-cap",
          "x-placeholder": "What's your explanation?"
        },
        "exampleSection": {
          "$ref": "#/$defs/section",
          "properties": {
            "exampleMultiLineTextEntry": {
              "$ref": "#/$defs/multiLineTextEntry",
              "default": "This explanation has not been given.\nIgnore it.",
              "description": "Explain what it is you want to achieve.",
              "maxLength": 5000,
              "minLength": 20,
              "title": "Explanation",
              "x-guidance": "It's useful to explain things here.",
              "x-icon": "academic-cap",
              "x-placeholder": "What's your explanation?"
            }
          },
          "x-flatten": false,
          "x-icon": "bookmark"
        }
      },
      "x-flatten": false,
      "x-icon": "bookmark"
    }
  },
  "additionalProperties": false
}