0

Amazingly, I cannot find any solutions that aren't hacks into the keyup event, and even those don't worry. I am stunned that I cannot in native HTML5 just restrict an input from having more than two decimals.

For example, after I filled in a number input with (10.22) if I typed another number, nothing would happen. I have not found anything on StackOverflow, is this seriously a "yet-to-be-solved" thing, since I can't find a good solution online?

Anthony
  • 13,434
  • 14
  • 60
  • 80
  • This helps? https://stackoverflow.com/a/18510925 – Derek Wang Oct 12 '20 at 02:05
  • I eventually fold a solution here but it was absurdly hard to find. I had to luck out with keywords in Google before I found it: https://stackoverflow.com/questions/15680506/how-to-prevent-keypress-two-digits-after-a-decimal-number/15680706#15680706 @Derek.W – Anthony Oct 12 '20 at 02:08

0 Answers0