Skip to main content

Multitext

A textbox that take multiple text input and renders the value as chip.

Schema

[
{
"name": "calendar-months",
"meta": {
"displayName": "Calendar Months in a Year",
"displayType": "multitext",
"placeholder": "Enter months",
"description": "enter months in a calendar year",
"readOnly": false,
"htmlProps": {
"allowDynamic": false
},
"validation": {
"required": true,
"requiredDetail": {
"errorMsg": "custom message for required detail"
}
}
}
}
]

Example

enter months in a calendar year

Form Data:
{}

required is set true

[
{
"name": "calendar-months",
"meta": {
"displayName": "Calendar Months in a Year",
"displayType": "multitext",
"placeholder": "Enter months",
"description": "enter months in a calendar year",
"validation": {
"required": true,
"requiredDetail": {
"errorMsg": "custom message for required detail"
}
}
}
}
]

value is a passed by default

[
{
"name": "calendar-months",
"meta": {
"displayName": "Calendar Months in a Year",
"displayType": "multitext",
"placeholder": "Enter months",
"description": "enter months in a calendar year",
"value": ["january", "february", "march"],
"validation": {
"required": true
}
}
}
]

Field Properties

NameDescriptionType
nameThe unique identifier for the multitext control instance.string
metaAn object containing the configuration and data for the control.object
displayNameThe display name of the control.string
displayTypeThe type of control, which is "multitext" in this case.string
placeholderThe placeholder text for the input field.string
descriptionA string providing additional information or instructions about the control.string
validationAn object for validation rules.object
requiredA boolean indicating if the control is required.boolean
htmlPropsA native object that has all the props of the mui componentobject
readOnlyA readonly field is not editable and value cannot be changedboolean
valuevalue is the content that render in the input componentstring[]

Field Properties - Validation Details

The validation settings within the Textarea component are crucial for ensuring that user input meets specific requirements. Here’s a breakdown of the available validation properties:

PropertyDescription
requiredBoolean value that specifies whether entering data into the field is mandatory.
minLengthSpecifies the minimum number of characters allowed in the input.
maxLengthSpecifies the maximum number of characters allowed in the input.
minSpecifies the minimum value allowed for number inputs, with support for dynamic values.
maxSpecifies the maximum value allowed for number inputs, also supporting dynamic conditions.
patternA regex pattern that the input must match to be considered valid.
validateA function for custom validation logic, which can return a boolean or an error message.
requiredDetailContains info msgs about the required validation property

Example Usage of Validation Properties

{
"name": "comments",
"meta": {
"displayName": "Comments",
"displayType": "textarea",
"validation": {
"required": true,
"minLength": 10,
"maxLength": 300,
"min": 10,
"max": 300,
"pattern": "/^[a-zA-Z0-9 .,'-]+$/"
},
"htmlProps": {
"minRows": 3,
"maxRows": 6
}
}
}