Skip to main content

Search

Phonenumber validation

Comments

1 comment

  • AdisJ

    Hi Bas,

     

    sure! The Regex (which is standard part of JavaScript) is what you need, it is actually not complicated at all. 

    Please take look at this thread: 

    https://my.skybow.com/hc/en-us/community/posts/360007688860-Looking-for-a-Javascript-solution-to-provide-validation-on-a-text-field

     

    There it is explained how to set up text field validation using Regex. You can validate anything that way.

     

    The regex expression (rule) which you might want to use ("at least 10 numbers"), is the following. It tells the validator that the field should be contained only from numbers, and should be at least 10 and maximum 15 digits long: 

     

    ^\d{10,15}$

     

    If you want to use international phone numbers in the format such a +49 123 456 - 789, you can use the following regex expression:

     

    ^\+(?:[0-9] ?){6,14}[0-9]$

     

    If you need a country specific formatting, you can easily google it, such the regex expressions can be easily found on the net. 

     

    Cheers,

    Adis

    0

Please sign in to leave a comment.