Form Template Element - Single Line Text Entry¶
Functional Behavior¶
A single line plain text entry field. Special characters are allowed. Line breaks, and Special formatted markup, such as Markdown are not allowed.
Visual Representation¶
A Text entry box that allows a single line of plain text up to the maximum number of allowed characters.
Parent Elements¶
The Single Line Text Entry form element, can appear as a child of:
Definition¶
Definition: Single Line Text Entry
Parameters¶
The Single Line Text Entry form element takes the following parameters:
| Single Line Text Entry | |
| Parameters | |
defaultThe value given if nothing is entered. |
|
|---|---|
| Required | optional |
| Type | string |
| Example | default: "Rocket" |
descriptionThe description of the field presented to the user during data entry. |
|
| Required | optional |
| Type | string |
| Content Media Type | text/markdown; template=handlebars |
| Example | description: "Whats your first name." |
maxLengthMaximum number of characters allowed in the field. |
|
| Required | yes |
| Type | integer |
| Example | maxLength: 300 |
minLengthMinimum number of characters allowed in the field. |
|
| Required | optional |
| Type | integer |
| Example | minLength: 2 |
titleThe label attached to the field. |
|
| Required | yes |
| Type | string |
| Content Media Type | text/plain |
| Example | title: "First Name" |
x-guidanceLong 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: "Its the thing your parents called you." |
x-iconThe name of the Icon to display with the field. |
|
| Required | optional |
| Type | string |
| Choices | Icons |
| Example | x-icon: "user" |
x-placeholderPlaceholder 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: "???" |
Example Usage¶
This is an Example Form Template showing just the Single Line Text Entry form element, and its parents.
Example:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "singleLineTextEntry Example",
"description": "An example of the singleLineTextEntry Element, and it's parents.",
"$defs": {
"section": {
"additionalProperties": false,
"type": "object"
},
"sectionOptional": {
"additionalProperties": false,
"type": [
"object",
"null"
]
},
"singleLineTextEntry": {
"contentMediaType": "text/plain",
"pattern": "^[^\\n]*$",
"type": "string"
}
},
"type": "object",
"properties": {
"exampleSection": {
"$ref": "#/$defs/section",
"properties": {
"exampleSection": {
"$ref": "#/$defs/section",
"properties": {
"exampleSectionOptional": {
"$ref": "#/$defs/sectionOptional",
"x-final-optional": true,
"x-flatten": false,
"x-icon": "bookmark"
},
"exampleSingleLineTextEntry": {
"$ref": "#/$defs/singleLineTextEntry",
"default": "Rocket",
"description": "Whats your first name.",
"maxLength": 300,
"minLength": 2,
"title": "First Name",
"x-guidance": "Its the thing your parents called you.",
"x-icon": "user",
"x-placeholder": "???"
}
},
"x-flatten": false,
"x-icon": "bookmark"
},
"exampleSectionOptional": {
"$ref": "#/$defs/sectionOptional",
"x-final-optional": true,
"x-flatten": false,
"x-icon": "bookmark"
},
"exampleSingleLineTextEntry": {
"$ref": "#/$defs/singleLineTextEntry",
"default": "Rocket",
"description": "Whats your first name.",
"maxLength": 300,
"minLength": 2,
"title": "First Name",
"x-guidance": "Its the thing your parents called you.",
"x-icon": "user",
"x-placeholder": "???"
}
},
"x-flatten": false,
"x-icon": "bookmark"
},
"exampleSectionOptional": {
"$ref": "#/$defs/sectionOptional",
"x-final-optional": true,
"x-flatten": false,
"x-icon": "bookmark"
}
},
"additionalProperties": false
}