I understand why numeric inputs allow "E" or "E" , but I'm confused about why it allows a few decimal places.
If you look at the specification of valid floating point numbers , you will get:
A string is a valid floating point number if it consists of:
- Optionally, the "-" character (U + 002D).
- One or both of the following, in this order:
- A series of one or more ASCII digits.
- One single. (U + 002E).
- A series of one or more ASCII digits.
- Not necessary:
- Either the character "e" (U + 0065), or the character "E" (U + 0045).
- Optional character "-" (U + 002D) or "+" (U + 002B).
- A series of one or more ASCII digits.
Everything that I see here indicates that only one decimal point should be allowed in the input file and that the decimal value must be included before the exponent is indicated with "e" and that there can only be one "e", regardless of , a business.
However, input data such as:
- 12
- ......
- uh ........
- 1.0.0.01.0
And so on.
In IE 11, it will allow me to enter any string I, but if it is not a "valid" .value number, it is "" . In this case, 1......e valid, but eeeeee is not. If IE determines that the value is invalid, then when focusing from the input, the display fades, preventing the user from changing the existing input.
In Chrome 51, it allows me to enter the numbers +/-, e / E and ".". When I check the input value as 10.0. with an additional decimal number, it still returns 10.0 , but if I 10.0.0 or 10.. , the line will return to empty. Chrome will keep displaying invalid input.
When strings become empty, this prevents further validation checks from entering input and provides useful user feedback.
So why are multiple decimal places allowed in number input fields, and why are they so weirdly handled between browsers?