must()
Enforce complex input criteria.
Setup
Attribute: sf-validation="must(number, lowercase, uppercase, symbols)"
Where: Applied to input
elements like password
, email
, etc.
Validates that the input meets specified criteria for characters. Ensures inputs c=ontain a combination of numeric, lowercase, uppercase, and special characters as defined.
HTML Example
Webflow Example
Usage Examples
must(1,2,1,0)
: At least 1 number, 2 lowercase characters, 1 uppercase character, and no symbols are required.must(0,1,1,1)
: At least 1 lowercase character, 1 uppercase character, and 1 symbol are required, with no number requirement.must(any,1,1,1)
: No limit on numbers, at least 1 lowercase character, 1 uppercase character, and 1 symbol are required.must(1,any,1,0)
: At least 1 number, no limit on lowercase characters, 1 uppercase character, and no symbols are required.
Attribute Configuration
Here are some instructions to keep in mind:
Ensure to format the attribute value as
must(number,lowercase,uppercase,symbol)
where each parameter defines the minimum count required for:number: Numeric characters
lowercase: Lowercase alphabetic characters
uppercase: Uppercase alphabetic characters
symbol: Special characters or symbols
All four arguments are required.
must()
validation can be paired with native HTML attributes likepattern
,maxlength
, orminlength
.You can pass
any
to indicate no limit for a specific criterion.
Last updated
Was this helpful?