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 https://github.com/googlei18n/libphonenumber/blob/master/resources/phonenumber.proto Now let us validate whether the number is valid: More examples on how to use the library can be found in the unittests at https://github.com/googlei18n/libphonenumber/tree/master/java/libphonenumber/test/com/google/i18n/phonenumbers 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.