How to create an editbox with mask for phone number like 7(9##)###-####

Posted by: a.koneva on 27 April 2022, 1:33 pm EST

  • Posted 27 April 2022, 1:33 pm EST

    Hi
    I would like to create a textbox with mask for phone number like 7(9##)###-####. But when I use C1TextBox with Editmask ""7(900)000-0000" it shows "7(___)___-__-__" so it treats "9" not as I want. I would like the control to show "7(9__)___-__-__".
    Please, help.

    Best regards,
    Anna.
  • Replied 27 April 2022, 6:26 pm EST

    Hi Anna,

    Since the '9' is a Mask character (Digit Placeholder [entry optional]) in the Edit Mask, you will need to escape it using the backslash '\' character to treat it like a literal in the Edit Mask string. Kindly refer to the attached sample showing the same.

    You can also refer to the link below to know more about the Edit Mask and Mask characters in C1TextBox

    https://www.grapecity.com/componentone/docs/win/online-input/editmask.html

    Best Regards,
    Kartik

    EditMask_TB.zip
Need extra support?

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

Learn More

Forum Channels