Skip to main content

validateForm

Validates the fields of the specified form according to its defined validationExpression.

Field Configurations

KeyTypeDescriptionDefault Value
"params" (required)Objectundefinednull

Parameters

KeyTypeDescriptionDefault Value
"async"BooleanSpecifies whether the action should perform asynchronously.null
"form"StringName of the form that should be validated. If not specified, the form of the current view will be validated.null
"onError"StringEvent that will be fired if the form is invalid.null
"onErrorType"OnErrorTypeType of the onError event."event"
"onSuccess"StringEvent tha will be fired if the form is valid.null
"onSuccessType"OnSuccessTypeType of the onSuccess event."event"

Inherited

From Base Action

Base Action

Field Configurations

KeyTypeDescriptionDefault Value
"dynamicParams"ObjectDynamic params to retrieve data from a specific context e.g. a userSetting.null
"leadingDelimiter"StringThe leading mustache delimiter to use.null
"params"Object,ArrayObject containing the properties of the action.null
"trailingDelimiter"StringThe trailing mustache delimiter to use.null
"type"StringType name of the action.null

Examples

Example: Validate form

Goal: Check, if the user input is as expected.

The validation expression of the form layer favoriteNumber only allows integers as input. If the input proves to be invalid, the specified validationErrorMessage of the form layer will be displayed.

{
"type": "validateForm",
"params": {
"form": "favoriteNumber",
"onSuccess": "validInput",
"onError": "invalidInput"
}
}

The actions to be executed are specified in the actions parameter, in this case a validateForm action.

Result:

A validateForm action has been created.