Validating phone number in javascript

Implementing a rigorous phone number formatting and parsing library was crucial for the phone OS overall usability (back then, in the early 2000s, it was originally meant to be a phone after all, not just a social media device). It can still be compiled into one big bundle which weighs 530 kilobytes (330 k B code 200 k B metadata) — quite a size for a phone number input component.

One part of me was curious about how all this phone number parsing and formatting machinery worked, and another part of me was curious if there was a way to reduce those 530 kilobytes to something more reasonable while also getting rid of all the unnecessary bulk and rewriting it all in pure javascript.

The overall syntax has mostly been ported but it's still quite far from finished and the code has not been tested, and I'm not searching for phone numbers in my projects, but if anyone needs that feature they could continue where I left off: see .

To find out if your web browser supports Java Script or to enable Java Script, see web browser help.

Often times we can give our users an example and they will still enter the wrong format.

I have created a script that will strip out all characters in a string except numerical digits.

Although Google's javascript port doesn't support this functionality the Java and C ports do.

I guess Google just doesn't need to crawl phone numbers on because they can afford to hire a Java/C developer to do that.

Search for validating phone number in javascript:

validating phone number in javascript-23validating phone number in javascript-78validating phone number in javascript-44

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “validating phone number in javascript”

  1. Answer 1: The phone number for Dollar Tree is (757) 321-5000. So busy that the lines were down the aisles and I, the Asst Mgr, was tasked with stocking freight, recovering, cleaning, blowing up balloons, and backup cashier.