String
All rules in this page can be applies to string
Equal
v.val("This string", "='This string'"); // trueStart with
Validates the input starts with the specified string in rule.
v.val("This string", "starts with 'This'"); // trueEnds with
Validates the input ends with the specified string in rule.
v.val("This string", "ends with 'string'"); // trueIn
Validates the input is contained by the specified string in rule.
v.val("string", "in 'a longer string that contains it'"); // trueContains
Validates the input contains specified string in rule.
Not empty
Validates the input is not empty.
Max length
Validates the length of the input is not exceed the max length.
Percentage
Validates the input is number in percentage format.
Base64
Validates the input is a valid base64 string
Number
Validates the input is a valid number format string
Int
Validates the input is a valid integer format string
Float
Validates the input is a valid float format string
Hex number
Validates the input is a valid hex number format string
Hex Color
Validates the input is a vallid hex color format string
Phone
Validates the input is a vallid phone number in P.R.C
Mobile
Validates the input is a vallid mobile phone number in P.R.C
Match regex
Validate the input matches user defined regex
Last updated
Was this helpful?