form_error
It is one of the return types of the submit handler. The form's error object allows you to throw an error message when instantly when a user adds an input that is not intended. Form error messages can be handled for the entire form or for individual fields as well.
Parameter | Description | Datatype | Max Limit |
type | Type of response | - | - |
text | Error text displayed for the entire form on submission | ||
inputs | Errors displayed for the respective input fields |
Sample Code:
Copied{
"type": "form_error",
"text": "$error_text", //Error shown for the entire form on submit
"inputs" :
{ // Error shown for respective field inputs
$inputname : "error_message"
}
}