Answer the question
In order to leave comments, you need to log in
What regular expression should be used to validate a number according to the requirements below?
Good afternoon.
When filling in some form fields, you need to limit the user's ability to enter numbers. Conditions:
The input type must be strictly number
Validation is done on the keyup and paste events
If the entered character does not match the rules, it is automatically erased (or if there are invalid characters in the inserted string, they are erased).
Only a positive integer or fractional number is considered valid. 0 is also considered valid.
In regular seasons, he is not strong, to shame and chagrin. Everything that I could dig up on the Internet does not work properly.
Answer the question
In order to leave comments, you need to log in
What regular expression should be used to validate a number according to the requirements below?None, for no reason.
Validation is done on keyup and paste eventsWhy not fool around and just use the input event?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question