Prevent letters and negative numbers being added in an input field
The following input field will only allow positive numbers and no letters or minus numbers. It basically says only keys 1 to 0 (1234567890) can be pressed on the keyboard.
<input type='number' onkeypress='return event.charCode >= 48 && event.charCode <= 57' min='1'>