Form messages
More information about the forms editor here
You can customize the messages displayed in your forms to provide more informative instructions and error feedback to users. By using custom messages, you can tailor the form's labels, descriptions, and error messages to match your specific requirements and provide clear guidance to users.
All these customizations enhance the user experience and ensure that users receive accurate feedback when filling out the form.
In the forms editor you will find a panel called “Messages”. In order to personalize the messages, in this panel you must specify a Json object where the keys refer to the element to add the message and the value, the message you want to add.
We can set custom messages for “label”, “descriptions” and “errors”.
Labels
The format followed is {{property-name}}.label
, example:
{
"myProperty.label": "My property",
"orherProperty.label": "Other property",
}
Descriptions
The format followed is {{property-name}}.description
, example:
{
"myProperty.description": "This is a custom description",
}
Remember that for the description to be displayed all the time you must have the "showUnfocusedDescription" option enabled in the UI Schema, indicating that the description should be displayed even when the control is not focused. For example:
{
"type": "VerticalLayout",
"elements": [
{
"type": "Control",
"scope": "#/properties/name",
"options": {
"showUnfocusedDescription": true
}
}
]
}
Errors
The format followed is {{property-name}}.error.<<errorType>>
, example:
{
"myProperty.error.minLength": "Must me greater than or equal than 3",
"myProperty.error.maxLength": "Must be less than or equal than 10",
"myProperty.error.required": "Required"
}