html input integer and positive
<input type="number" min="0" step="1" />
Source:stackoverflow.com
input number maxlength
Source:stackoverflow.com
simple way to make a text field to accept numbers only with maximum number of length 13 digit and min 10
<input name="phoneNumber"
oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);"
type = "number"
maxlength = "10"
/>
input max length
<input maxlength="10" />
Source:developer.mozilla.org
how to limit input type max length
<input name="somename"
oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);"
type = "number"
maxlength = "6"
/>
Source:stackoverflow.com
input type number maxlength
<input type="text" pattern="\d*" maxlength="4">
Source: stackoverflow.com