Answer the question
In order to leave comments, you need to log in
Allow range of numbers by regex?
How can I allow a range of numbers to be entered by a regular expression?
For example, from 1 to 100 inclusive..
check: if( var >= 1 and 100 <= var )...
not suitable, because the regular expression will go into the input field
<input type="text" pattern="RegEx" title="только от 1 до 100">
Answer the question
In order to leave comments, you need to log in
What for? HTML5 has a special field for this.
<input type="number" min="1" max="100" value="1" step="1">
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question