US PHONE NUMBER VALIDATION IN SENCHA TOUCH

Jeet Verma

Total Post:110

Points:776
Posted by  Jeet Verma
 1904  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. Arun Singh

    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 Aug-06-2013 01:50:46 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!