Validating phone number in javascript

This tutorial will helps you how to validate a mobile number in Java Script.

In this example we have created a Mobile Number Validation Form that displays the Mobile Number, Phone No. We have used Java Script to validate the Mobile Number to 10 digits and Phone Number to 10 Digits.

For details on the meaning of each field, refer to Now let us validate whether the number is valid: More examples on how to use the library can be found in the unittests at Several people are porting the phone number library to other languages. Note that they are done on voluntary basis by developers outside our project, so we cannot guarantee their quality.

In forms when asking for phone numbers fields it is a good idea to use client side validation along with your programming language validation.


If a programmer enters a wrong phone number or mobile number or enters email-id in a different format, it shows an error message and asks the user the correct phone number and email-id.

The following example shows how you can validate an International Phone number in your forms using Javascript.


Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>