Posted By : Murugan Andezuthu Dharmaratnam
Posted On : 5 February 2015
Keywords : JQuery Phone number validation,Phone number validation using JQuery,Phone number validation,Client side phone number validation,Sample code for phone number validation

Validate Mobile Phone Number Using JQuery

Phone Number Validation In JQuery Using Regular Expressions

This Jquery Code Check if the phone number is valid. If the Phone Number is not valid the text is replaced with a message "Invalid Phone Number" in the text Placeholder.

Expected Output

Code Snippet

    <script src=""></script>
    <script type="text/javascript">

        $.fn.isPhoneNumber = function (options) {
            intRegex = /^[0-9]{1,10}$/;
            phoneNumber = this.val();
            if ((phoneNumber.length != 10) || (!intRegex.test(phoneNumber))) {
                this.attr("placeholder", "Invalid Phone Number");
                return false;
            return true;

        function validate() {
            return false;
    <input type="text" id="checkPhoneNumber" value="ASDFG77" />
    <input type="button" onclick="return validate()"  value="Validate"/>

Download Sample Code

Click Right Click here and select "save link as" to download Sample Code. Click here To View sample code working

Murugan Andezuthu Dharmaratnam

Murugan is a technology leader with 14 years of hands-on experience in full life cycle systems design, development, implementation, and management. In addition to systems design and development, his core competencies include cloud design and architecture, interactive web applications and websites development, mobile computing, and Healthcare Information Technology. His experience is very diverse with a broad range of technologies within multiple industry settings including private, public, and non-profit. Coupled with his technology expertise, Murugan is a well-organized, result-oriented, and a highly analytical leader with proven track record in developing and implementing very complex systems.