Question and answer is powered by AnsPress.io
I have set max length in my HTML input number field, but it not working. It gets max length from my defined max length. How can I fix it?
My HTML:
<input type="number" min="1" maxlength="4" name="qty[]" class="form-control qty">
If the max length not working, apply this code hope it will be helpful for you.
<input type="number" min="1" oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);" maxlength="4" name="qty[]" class="form-control qty">