Pattern not working with readonly attributes
up vote
0
down vote
favorite
I have this form where user need to submit the num of days and it cannot be less than 1. So, I put a pattern there and with read only attribute. My question is, why the pattern is not working when I put the readonly attribute? Let say, the numofdays is zero, supposedly when I submit, it will say the pattern is not match. But, when I put the readonly, the pattern is not working and the form is submitted even if the pattern is not correct. Is there any way that I can do this? HTML <form> <input class="form-control" type="text" name="numofdays" id="id1" value="diffdays" pattern="[1-9]" title="No of days should not be less than 1" readonly> <input type="submit" value="Submit" class="btn bt...