How to restrict the input field to enter only numbers/digits int and float both.
Sometimes we need to allow both integer as well as float value for fields like amount, so in that case the validation is required. There are no of solutions available but they are of large size code. So need a short but effective code.
<p> Input box that accepts only valid int and float values.</p> <input class="number-only" type=text />