Reputation: 99
I am using this input
in one of form.why is it let user to type e character?.I am testing an web-application.
<input type="number" class="form-control" id="mobile" name="mobile"
placeholder="Enter Mobile" data-type="alphanum" />
Upvotes: 2
Views: 58
Reputation: 4700
Because that's exactly how the spec says it should work. The number input can accept floating point numbers, including negative symbols and the e
or E
character:
A floating-point number consists of the following parts, in exactly the following order:
- Optionally, the first character may be a "
-
" character.- One or more characters in the range "
0—9
".- Optionally, the following parts, in exactly the following order:
- a "
.
" character- one or more characters in the range "
0—9
"- Optionally, the following parts, in exactly the following order:
- a "
e
" character or "E
" character- optionally, a "
-
" character or "+
" character- One or more characters in the range "
0—9
".
--
Upvotes: 1
Reputation: 364
e
is a valid mathematical number which equals to 2.718
to 3 decimal places.
Read more: Mathematical constant e
Upvotes: 3