html input number only positive code example
Example 1: html input integer and positive
<input type="number" min="0" step="1" />
Example 2: input positive numbers only
<input type="text" onkeypress="return (event.charCode == 8 || event.charCode == 0 || event.charCode == 13) ? null : event.charCode >= 48 && event.charCode <= 57" name="itemConsumption" />
^------------....
//copy the onkeypress function :D