US Phone number validation in sencha touch

Total Post:110

Points:776
 2348  View(s)
Ratings:
Rate this:
Hi Developers,

I have created employee information form in sencha touch as following structure

Emp Id
Emp Name
Emp Address
Emp Email Id
Emp Mobile

My Problem is, I want to validate US Mobile number.
Please help.
Thanks in advance. 
  1. Post:68

    Points:476
    Re: US Phone number validation in sencha touch

    Hi Jeet Verma,

    Sencha Touch provides many type of validation such as Email, Exclusion, Format, Inclusion, Length and Presence Validation to validate your Form in appropriate manner. Now come to your question, To resolve this problem you can use Format Validation like as:
     
    validations: [
                    { type: 'format',   name: 'mobile', matcher: /^(\([0-9]{3}\) |[0-9]{3}-)[0-9]{3}-[0-9]{4}$/, message:"Wrong Format for Mobile Number"},
                ]
            });
    I hope it might be resolve your problem!! 

      Modified On Mar-30-2018 05:47:50 AM

Answer