Make Apps
Search
K

Text

Text value

The list of common settings for parameters is available here.

Specification

multiline

  • Type: Boolean
  • Default: False
  • If true, the user will be able to insert new lines in GUI (a textarea will be displayed instead of the text field).

tags

  • Type: String
  • Specifies how to treat HTML tags.
  • Allowed values:
Key
Specification
strip
Removes HTML tags.
stripall
Removes all HTML tags (including unclosed).
escape
Converts < , > and & to HTML entities.

validate

  • Type: Object
  • Specifies parameter validation.
  • Available parameters:
Parameter
Type
Specification
max
number
Specifies maximum length.
min
number
Specifies minimum length.
pattern
string
Specifies a RegExp pattern that a text parameter should conform to. Note: In most cases, the pattern has to be wrapped in ^ and $ e.g. ^[a-z]+$ in order to validate the whole input, not just a part.

nested

  • Available types:
    Type
    Specification
    array
    Provides an array of nested parameters which are shown when the value of the parameter is set (value is not empty)
    string
    Provides URL address of an RPC to load list of nested parameters.
    object
    Provides a detailed specification of nested parameters.
Usage of nested fields:
{
"name": "myText",
"type": "text",
"label": "My Text",
"nested": "rpc://getNestedFields"
}

Examples

Basic Text Field

A basic text input.
Appearance
Source
Example of Basic Text Field
[
{
"type": "text",
"label": "Name",
"name": "name"
}
]

HTML Tags Stripping

You can enable HTML tags stripping or escaping using the tags option.
Appearance
Source
Output
Example of Stripped and Escaped Fields
[
{
"type": "text",
"label": "Stripped field",
"name": "stripped",
"tags": "strip"
},
{
"type": "text",
"label": "Escaped field",
"name": "escaped",
"tags": "escape"
}
]
Stripped field
Hello world
Escaped field
&lt;h1&gt;Hello world&lt;/h1&gt;

Validating Length

By setting validate.max and validate.min you can control the length of the inserted string value.
Appearance
Source
Example of Field with Length Validation
[
{
"type": "text",
"label": "Validated string",
"name": "validated",
"validate": {
"max": 32,
"min": 10
}
}
]

Validating Pattern

You can use a RegExp to validate the text input.
Appearance
Source
Example of Field with Pattern Validation
[
{
"type": "text",
"label": "Validated string",
"name": "validated",
"validate": {
"pattern": "^[A-Z ]+$"
}
}
]

Multiline Textarea (deprecated)

To allow entering multiline texts, set multiline to true.
Appearance
Source
Example of Multiline Textarea
[
{
"type": "text",
"label": "Message",
"name": "message",
"multiline": true
}
]

Search Button

You can add an RPC button (also called as a search button), to perform an RPC call inside the field. Usually used to find an ID of a specific item.
You can read about it here or click below to read about the select parameter vs search button.
Last modified 10mo ago