Minlength not working on tel field with zero
-
Many thanks for your great plugin.
After some experimentation, I have found that the minlength parameter on a tel field does not work when someone enters a single zero as the telephone number. For example if I use:
[tel* your-phone minlength:8]
and I enter a telephone number of 5 digits and click on Send, I get the error message
The field is too short.
as expected.
But if I enter a telephone number of 0 (just the single digit zero) then click on Send, I do not get this error message. It seems to treat zero as satisfying the “required” nature of the field (tel*) but it does not correctly detect that the number is too short. I have replaced tel* with tel but it still does not detect any error on the length of zero.
Is there some trick so that the field is judged too short when someone just types a single zero?
- The topic ‘Minlength not working on tel field with zero’ is closed to new replies.