Good evening, I'm having trouble creating a mask that accepts both a cell phone number and phone number in the same textbox, I tried to use maskedinput but it did not roll .. any idea how I could do it? And in which event would it be best to place? (keypress, keyup, keydown, leave)
Thank you in advance for your help!
Here's a snippet of the code I've made so far using maskedinput.
String telefone = Useful_methods.TextNoFormatting(txtTelefone_1);
if (telefone.Length >= 10)
{
txtTelefone_1.Mask = "(00)00000-0000";
txtTelefone_1.Select(txtTelefone_1.Text.Length, 1);
}
else
{
txtTelefone_1.Mask = "(00)0000-00009";
}