Forums

Forums / Developing Portals / Custom phone validation

Custom phone validation

3 posts, 1 answered
  1. Krishna Hari
    Krishna Hari avatar
    65 posts
    Registered:
    05 Dec 2019
    18 Mar 2020
    Link to this post
    How do I do a custom phone validation which would take both us and international phone numbers . I tried custom phone mask for it but did not accept international phone 
  2. Paul O'Toole
    Paul O'Toole avatar
    1 posts
    Registered:
    02 May 2019
    08 Apr 2020
    Link to this post
    Hi Krishna 

    I'm trying to do the same. Did you figure this out yet?

    Paul
  3. Andre B
    Andre  B avatar
    16 posts
    Registered:
    10 Mar 2020
    Answered
    11 May 2020
    Link to this post
    Hi Krishna, thank you for your question.  I would suggest trying the RegEx option instead. I've provided a link to a website where you can find regular expressions used to validate such telephone numbers. Also, it might be useful to utilize the placeholder option to indicate the desired format.

    Internation Regex - http://regexlib.com/(X(1)A(4rV-1X-anCBhV4U-VqVNWC1add29QjnvHFBBAyiCMwutK_yqeJ4galP2N92D_eN24wN76wdi9rBsHI8VYwUb-c-zAlsnTHydelKlpXP2ehzPJn1kjq4jC8W14N7lsL3_07AFAnvJTJyPQhJUU48lc_y6h977JuY33lQ7kGfcGoQh9lIrDLNTpWwjm0LDsUB90))/Search.aspx?k=international+phone&c=-1&m=-1&ps=20

    As there are many possible combinations to account for when validating both US and international telephone numbers, I would also recommend taking a look at a Javascript library designed for such a task. For example, Intl-tel-input might be worth looking at.

    intl-tel-input -  https://github.com/jackocnr/intl-tel-input

    If you need further assistance with this task, you can contact TPC Support at support@crmportalconnector.com.
    Last modified on 31 Jul 2020 13:07 by Patrick
3 posts, 1 answered