Javascript function for validating phone number

Rated 3.93/5 based on 697 customer reviews

You might get better results asking in a forum where people who know javascript might go. provides a declarative way of validating javascript objects.Recipe 2.1 explains which special characters need to be escaped. 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.

The attributes must be a plain object or a form element, things like backbone models etc are not supported.If you want to modify which values are considered empty for example you can simply overwrite You can find some basic examples included in the project.They are meant to give a feeling for how to use the library and should not be considered production ready code.Hi I need to validate my mobile number it wants to be in 91-1234567890 this format If i enter 1234567890 its wants to show alert message your mobile wants to be in 91-1234567890 format If i enter 9112345678901 its wants to show alert message your mobile wants to be in 91-1234567890 format If i enter 9112345678901 its wants to show alert message your mobile wants to be in 91-1234567890 format and then the correct mobile format 91-1234567890 wants to save in My sql database. If the application is india based then you can proceed with 91 as country code or keep an array of all country codes and change the validation accordingly. All i can say is investigate regular expressions this is a very simple one Hi Arun Please check this code. Also make use of component level of validation to restrict the user to enter only numerics and characters " " and "-" 2.

Leave a Reply