Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There should be seperate types:

    <input type=integer>
    <input type=float>
We need 2 different input keyboards on mobile: it should not be possible to type a dot if the input must be an integer.

Currently seems to difficult to get a simple integer input: Chrome and Safari does not interpret step=1 as "no decimals".

Also: the up/down buttons should go. That should be an explicit option as they don't make sense in most cases. Might have a type=count for that.



I was just looking into this today. iOS shows a decimal separator (a comma in the Netherlands) with `inputmode=decimal` and none for `inputmode=numeric`. You can try it out here: https://output.jsbin.com/necuzoj


Also fixed precision (aka currency) values.


Might be woth having a

    <input type=currency currency=DKK>
so the keyboard input can clearly show the currency that is entered. This can be very important in multi-currency applications, e.g. travel (both customer and admin).

Currency attribyte is ISO code: https://en.wikipedia.org/wiki/ISO_4217

Also: <input type=count>

which shows up/down arrows, and is a special case of <input type=integer>


That actually sounds like an idea whose time has definitely come. Anyone here on the HTML standards body (or works for Google in the requisite part of the Chrome team)?

There are other uses for fixed precision besides currency (co-ordinates, tolerances, etc.), but currency would be used a LOT!


Or even have a separate attribute to indicate that it only allows integers and maybe one to enable/disable the up/down buttons.


Very good summary of the issues I've found with it as well. I've had to instruct my developers to never use this input type, and use an Angular directive to limit input values instead.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: