Comments (6)
Hey @ksouthworth!
Have you checked out this method?
from telephone_number.
Yes I've seen that formatter method, but that only works when we already have a phone number, correct? In this case I don't know the phone # or country code yet on the front end, until the user submits the form/page.
from telephone_number.
@ksouthworth, I see now. That makes sense. I'm not sure that it's something we'll be able to do. Here's why:
Phone number validation/formatting in North America is pretty straight-forward because we really only have 1 standard format that we abide by. For example, we know that all phone numbers will be 10 digits long which makes providing a formatting "hint" easy. The problem is that other countries don't have simple rules like this. Phone numbers within a single country can be of varying lengths and some of the formats are entirely dependent on the phone number itself. This means we wouldn't really be talking about a single hint, but rather many different hints (or formats) that the input could abide by.
If you don't know the formatting or the country code yet, there really are an infinite number of hints that we could provide.
Does that clear things up?
from telephone_number.
Yes that makes sense. If we knew the country code ahead of time, would that narrow the list of possible hints down to a reasonable number (1 to 3) you think?
If we knew the Country Code when the page loaded, could possibly show a hint (or 2) that way...?
from telephone_number.
Hey @ksouthworth,
Unfortunately, I don't think it's going to be something we'll be able to support. Because countries can support many different formats, we won't be able to narrow it down to just one or two. Additionally, formatting rules are generally with regex, so extract hints from regex would be a pretty difficult task.
from telephone_number.
Ok, thanks for considering it, and thanks for this gem!
from telephone_number.
Related Issues (20)
- not working for Indian mobile number HOT 2
- Phone number showing valid even if it's invalid HOT 3
- New 464 area code comes this Friday to 708 region - Jan 18, 2022
- Gem does not support the numbers from Sri Lanka and Vietnam HOT 1
- Country Code UMI Not Supported - United States Minor Outlying Islands
- Version 1.4.17 seems to have disappeared HOT 1
- Error messages for validation failure HOT 1
- Giving invalid validation for following numbers
- Giving invalid validation for following US number HOT 1
- Bring data up to date with upstream v8.13.18
- Giving invalid validation for following US number
- Phone invalid when using [:mobile] without country code. And validator auto detect?
- Phone Parser bad result
- How Get National Area Code
- invalid number that is valid HOT 1
- CHANGELOG.md file missing HOT 1
- Phone numbers in Ivory Cost will change format by the end of January 2021 HOT 2
- How to run and csv upload HOT 6
- Support for multiple countries? HOT 1
- e164 formatted number contains duplicate country code HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from telephone_number.