I try like this :
<input type="number" pattern="[1-9]*" class="form-control" min="1">
I try input dot, it can
How can I disable dot(.) and another?
So, only 1-9
I try like this :
<input type="number" pattern="[1-9]*" class="form-control" min="1">
I try input dot, it can
How can I disable dot(.) and another?
So, only 1-9
The same way you have min
, you can add max=9
:
<input type="number" class="form-control" min="1" max="9">
You will need to have some custom JavaScript validation (there are libraries for that) to interpret the min
and max
attributes for those browsers which do not support them natively.
You can also use the pattern attribute in html5:
<input type="text" name="name" pattern="[0-9]" title="Title" />