1

How to stop to enter alphabets in input type number in Mozilla after removing spinners using CSS

input[type=number] {
    -moz-appearance:textfield;
}
RamAnji
  • 470
  • 3
  • 12
  • 3
    It's because by setting `-moz-appearance:textfield;` you've effectively turned the input in to a `type="text"`. If you want users to only be allowed to enter numbers without the spinners you'll need to use a standard `text` input, and restrict the characters with JS, like this: https://stackoverflow.com/a/469362/519413 or this: https://stackoverflow.com/a/995193/519413 – Rory McCrossan Oct 30 '19 at 10:18
  • 1
    On a side note, firefox allows entering non-numeric characters into `input type="number"` anyway – Andrey Oct 30 '19 at 10:31

0 Answers0