input field only one digit code example
Example: make only one digit input box
<input type="text" maxlength="1" oninput="this.value=this.value.replace(/[^0-9]/g,'');" />
<input type="text" maxlength="1" oninput="this.value=this.value.replace(/[^0-9]/g,'');" />