3
You can force this with an event headphone from keydown
which detects whether the character entered is a digit by comparing the key code.
An example would be:
var input = document.querySelector('input[name="EstoqueProd[]"]');
input.addEventListener('keydown', function(e) {
var numero = (e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode >= 96 && e.keyCode <= 105);
var controlos = [8, 37, 39].includes(e.keyCode);
if (!numero && !controlos) return e.preventDefault();
});
<input type="number" name="EstoqueProd[]" class="form-control" min="1" value="1" />
Perfect Sergio. It worked. Thank you again!
– user24136
Numeric keypad failed :O
– Sam
@Well viewed DVD, fixed.
– Sergio
Sérgio, Backspace does not work in this solution
– Good Bye Blue sky
@Brenocosta actually not even the arrows... here comes another Dit :)
– Sergio
@Brenocosta corrected. Thank you.
– Sergio