US Phone number validation in sencha touch

Total Post:110


 2648  View(s)
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. 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


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.