1

Okay, so I've been having a conundrum: how to make the max displayed to be fancy on attempted input above the max.

Take the following example:

    <input type="number" min="0" max="10000000000" step="1">

The max value allowed is 10 billion. But, when someone enters 10 billion plus one, it says something along the lines of "the max allowed value is 10000000000" (I forget what it says exactly, but that's the gist)

The problem comes with the "10000000000" it tells you. At first glance I have absolutely no idea how many zeros are there (even at second or third glance it's hard, how many times have I screwed up counting them on my screen). What I'd love for it to tell me is the following: "the max allowed value is 10,000,000,000" (with commas). Even "the max allowed value is 10 000 000 000" or "the max allowed value is 10.000.000.000" with spaces or decimals would be preferred over a large string of numbers that confuses anyone who gets the message.

So, does anyone know if it is possible to format the browser response like that?

AliNajafZadeh
  • 1,216
  • 2
  • 13
  • 22
Witold Kowelski
  • 924
  • 2
  • 12
  • 27
  • Does this answer your question? [HTML5 form required attribute. Set custom validation message?](https://stackoverflow.com/questions/5272433/html5-form-required-attribute-set-custom-validation-message) – Tom Sep 07 '22 at 08:32

1 Answers1

1

I believe you can just do 1e10.

Targuinius
  • 11
  • 1