I would like to restrict a text input field in a HTML5 form. I need it only value from 1 to 5
My code is
<input type="text" name="count" pattern="[1-5][0-9-.]{1,10}" value="1" required>
Do match (Expectation):
1
1.5
1.584
2
4.68756
5
Don't match (Expectation):
0
.5
0.99
01
05
5.1
6
[a-zA-Z] and other special characters
Now happened (the problem):
- Not validate non decimal values (1,2,3,4 and 5).
- Validates 5.1 to 5.9