0

Hello I'm facing the issue, when I change the input type text to number then it will allow the small and capital E latter rest of all letter will not able to type from keyboard but how can we prevent this error using js in magento2

please check the images below

enter image description here

1

This question explain this. It's because "e" can represent a floating number.

https://stackoverflow.com/questions/31706611/why-does-the-html-input-with-type-number-allow-the-letter-e-to-be-entered-in/31706796

|improve this answer|||||
0

The latter "e" and "E" represent a floating number when you use the number as input type.

use below code to prevent it

<input type="number" onkeydown="return event.keyCode !== 69" />
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.