minmax()
Ensure numbers fall within a range.
Setup
Attribute: sf-validation="minmax(MIN_NUM, MAX_NUM)"
With minmax()
, you can validate that the input number value meets the required criteria. For example, the numeric value should be greater than or equal to 2 and less than or equal to 10.
HTML Example
Webflow Example
More Examples
minmax(0,10)
: Allows values that are greater than or equal to 0 and less than or equal to 10.minmax(5)
: Allows values that are greater than or equal to 5, with no restriction on the maximum value.
Attribute Configuration
Make sure to add the sf-validation="minmax(MIN_NUM,MAX_NUM)"
attribute key-pair to valid input types as mentioned above. Here are some instructions to keep in mind:
The attribute value should follow the format
minmax(MIN_NUM,MAX_NUM)
orminmax(MIN_NUM)
.
Last updated
Was this helpful?