Open trusteddigital opened 6 years ago
Clearly in this example I could have a custom error stating the exact 11 character requirement
You'll need use the custom message attribute data-validation-error-msg
or data-validation-error-msg-length
if you have combined several validation rules.
I may be missing something here but I've dug deep and can't find what I'm after. I want to validate on an exact length of string.
It's for a number which must be 11 digits long. So I'm using
<input type="text" data-validation="length" data-validation-length="11">
However whenever the input is not 11 digits, I'm getting the error
"The input value must be between 11 characters"
Rather than "must be 11 characters"
I understand that it's interpreting this as a range. The Readme itself states
"length — min/max/range"
Is there another function for doing exact lengths. Is it edge-case? Seems like a fairly reasonable thing to be able to want to do.
Thanks!