length()
Ensure input values always meet character length requirements.
Setup
Attribute: sf-validation="length(MIN_NUM,MAX_NUM)"
Enforces input length restrictions within a form field. This validation ensures that only the specified range of characters are allowed, enhancing form data integrity and user input accuracy.
HTML Example
Webflow Example
Usage Examples
length(0,10)
: Minimum of zero characters are allowed, and the maximum number of characters can be up to 10.length(5)
: Minimum of 5 characters are required, with no restriction on the maximum length.
Attribute Configuration
The attribute value should follow the format
length(MIN_NUM,MAX_NUM)
orlength(MIN_NUM)
.length()
validation can be paired with native HTML attributes likepattern
.
Video demonstration
Last updated
Was this helpful?