Validators Schema
Add validators to a question with the validators array. Use validators when built-in required checks are not enough.
Validator Types
Section titled “Validator Types”numeric— number range validationtext— text length validationanswercount— selected-choice count validationregex— regular expression validationemail— email format validationexpression— custom expression validation
Examples
Section titled “Examples”{ "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." } ]}Common Properties
Section titled “Common Properties”- Type:
string - Required: Yes
Validator type.
- Type:
string - Localizable: Yes
Validation error message shown when validation fails.
Type-Specific Properties
Section titled “Type-Specific Properties”numeric
Section titled “numeric”minValue: minimum accepted numbermaxValue: maximum accepted number
minLength: minimum text lengthmaxLength: maximum text length
answercount
Section titled “answercount”minCount: minimum number of selected choicesmaxCount: maximum number of selected choices
regex: regular expression pattern string
expression
Section titled “expression”expression: Boolean expression that must evaluate to true
Use { "type": "email" }. No extra properties are required.