There is a input type which is used for input fields that should contain numeric values. Restrictions can be set on the numerical value, but it depends on the browser's support.
HTML file: | Displayed by browser: |
---|---|
<form>
Quantity (between 1 and 5): <input type="number" name="quantity" min="1" max="5"> <input type="submit"> </form> |
You should be able to see your submission in the address field (URL address bar) of your browser.