Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@ScriptCoded yes. On mobile it opens the ten-key keyboard instead of the full keyboard. It acts just like type=text everywhere else.
https://developer.mozilla.org/en-US... -
You should put this up on GitHub, and allow for further country formats to be added
-
@RiderExMachina any format using a number as it's placeholder character is invalid. So it doesn't work.
-
@RiderExMachina nah I mean the 0's not the period, maybe I'm missing a joke.
___.___.____ works but as a format string but any format string with numbers is invalid. That's why 000.000.0000 is invalid.
Hell you could do a-a-a-a-a-a-a-a-a-a and it would actually work. -
@ThatDannyBoy
I was using the 0s as an example for the ___.___.____ format. I guess there was a small disconnect
Related Rants
I've created a little functional script you can use for formatting US phone numbers. You can check it out here: https://codepen.io/datwood/full/....
I'm sure there are improvements I haven't thought of so feel free to mention any you think of.
I've built it so that it can work any input field set to type=tel that has a placeholder.
random
phone
functional
numbers
js
formatting