Skip to content

Validators Schema

Add validators to a question with the validators array. Use validators when built-in required checks are not enough.

  • numeric — number range validation
  • text — text length validation
  • answercount — selected-choice count validation
  • regex — regular expression validation
  • email — email format validation
  • expression — custom expression validation
{
"type": "text",
"name": "email",
"title": "Email address",
"inputType": "email",
"isRequired": true,
"validators": [{ "type": "email", "text": "Enter a valid email address." }]
}
{
"type": "checkbox",
"name": "interests",
"title": "Select up to three interests",
"choices": ["Product", "Support", "Billing", "Training"],
"validators": [
{ "type": "answercount", "maxCount": 3, "text": "Choose no more than three." }
]
}
  • Type: string
  • Required: Yes

Validator type.

  • Type: string
  • Localizable: Yes

Validation error message shown when validation fails.

  • minValue: minimum accepted number
  • maxValue: maximum accepted number
  • minLength: minimum text length
  • maxLength: maximum text length
  • minCount: minimum number of selected choices
  • maxCount: maximum number of selected choices
  • regex: regular expression pattern string
  • expression: Boolean expression that must evaluate to true

Use { "type": "email" }. No extra properties are required.