Giter Site home page Giter Site logo

Validation? about rmphoneformat HOT 5 CLOSED

rmaddy avatar rmaddy commented on August 19, 2024
Validation?

from rmphoneformat.

Comments (5)

rmaddy avatar rmaddy commented on August 19, 2024

If you format a phone number and get back the same string, then you know it is valid. But it depends on what validation you want done. For example, in the US, many formatted phone numbers come back as "(123) 456-7890". If I pass in that value for formatting, the formatted value is the same so you know it is valid. But if you want to consider "1234567890" or "123-456-7890" as valid, then I would need to add a method for validation.

from rmphoneformat.

naotokui avatar naotokui commented on August 19, 2024

Thanks for your quick comment.

When you format "(123) 456", you get the same "(123) 456", right? But it's obviously too short and not valid as a phone number.

Yes, I'd like to consider both "1234567890" and "123-456-7890" as valid.

On Jan 11, 2013, at 11:26 AM, rmaddy [email protected] wrote:

If you format a phone number and get back the same string, then you know it is valid. But it depends on what validation you want done. For example, in the US, many formatted phone numbers come back as "(123) 456-7890". If I pass in that value for formatting, the formatted value is the same so you know it is valid. But if you want to consider "1234567890" or "123-456-7890" as valid, then I would need to add a method for validation.


Reply to this email directly or view it on GitHub.

from rmphoneformat.

rmaddy avatar rmaddy commented on August 19, 2024

Yes, you are right about that format check. I will see about adding a validation method. Thanks.

from rmphoneformat.

rmaddy avatar rmaddy commented on August 19, 2024

An update has been committed. Please see the update code and the update README file for details about the new method for validation.

from rmphoneformat.

naotokui avatar naotokui commented on August 19, 2024

Wow! Thanks a lot!

from rmphoneformat.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.