I have an input
field as follows
<input class="calc-parameter" type="number" placeholder=""
data-parameter-name="NUMERIC" maxlength="12" id="NUMERIC-2-0">
On all browsers, I am getting the spinner and/or the keyboard is only allowing numbers to be entered
On Microsoft Edge, the user can enter numbers or characters into the field. Is there another property I need to add for Edge to consider this a numeric field only? Or is this a known Edge bug? I could not find anything on the Microsoft forums
They claim its supported: https://caniuse.com/#feat=input-number but does not include the spinner feature.
However there is a bug filed in that the functionality doesn't work: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10792541/
Ran into this one myself.
I know I'm late to the party but if someone is still looking for a workaround in Jquery whilst Edge catches up with google:
$('input[type=number]').on('keypress', function (e) {
// Add whatever keys you want to the condition (48-57 = numbers)
if (e.keyCode < 48 || e.keyCode > 57) {
e.preventDefault();
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With