Control for entering USA mobile phone number

Posted by: a.koneva on 5 May 2022, 10:12 am EST

  • Posted 5 May 2022, 10:12 am EST

    Hi
    I would like to create a control for entering USA mobile phone number.
    From wikipedia:
    country code +1
    Area code structure:
    N-X-Y
    N is not 0 or 1
    X is not 9
    X ≠ Y
    Phone number length 10

    How can I create such mask in C1 or maybe not by mask, maybe anything else? I try to use C1TextBox.
    Best regards.
    Anna.
  • Replied 5 May 2022, 9:24 pm EST

    Hi Anna,

    To validate the mobile phone number input according to your conditions, you can use the PreValidating event of the C1TextBox to check whether the input matches your specified conditions. If it does not pass the validation, you can cancel the validation and provide errors. Kindly refer to the attached sample showing the same.

    Kind Regards,
    Kartik

    USAMobileMask_C1TB.zip
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels