Skip to content

Form Validation ​

Form validation ensures user input data validity. FormCreate designer provides rich validation rule types for configuring various validation scenarios.

Note

  • Validation Trigger Timing: Supports three trigger methods: blur (blur), change (value change), submit (submit)

  • In custom validation, access component and form information through this.rule and this.api to get values from other components during validation.

  • When pattern type is string, don't include / symbols before and after, otherwise the regular expression will be invalid.

  • In custom validation, the callback function must be executed whether validation succeeds or fails.

Validation Rule Types ​

FormCreate designer supports the following validation rule types:

Basic Validation Rules ​

KeyRule NameDescription
lenLengthValidate string length equals specified value
minLenMinimum LengthValidate string minimum length
maxLenMaximum LengthValidate string maximum length
minMinimum ValueValidate numeric minimum value
maxMaximum ValueValidate numeric maximum value

Format Validation Rules ​

KeyRule NameDescription
patternRegular ExpressionCustom regular expression validation
emailEmail FormatValidate email format
urlURL FormatValidate URL format
ipIP AddressValidate IP address format
phonePhone NumberValidate phone number format

Character Validation Rules ​

KeyRule NameDescription
uppercaseAll UppercaseValidate must be uppercase letters
lowercaseAll LowercaseValidate must be lowercase letters
positivePositive NumberValidate must be positive number
negativeNegative NumberValidate must be negative number
integerIntegerValidate must be integer
numberNumberValidate must be number

Advanced Validation Rules ​

KeyRule NameDescription
validatorCustom ValidationCustom validation function

These validation configurations let you build a fully functional and user-friendly form validation system.