By clicking "Sign Up", you agree to our terms of service and privacy statement

Remember password?

  • 9 answers
  • 92 views

How to create a website with React?

I have a problem masking a phone input with jQuery and Masked Input Plugin. There are 2 possible formats:

(XX)XXXX-XXXX
(XX)XXXXX-XXXX

Is there any way to mask it accepting both cases?
EDIT:
I tried:

$("#phone").mask("(99) 9999-9999"); 
$("#telf1").mask("(99) 9999*-9999");    
$("#telf1").mask("(99) 9999?-9999"); 
But it doesn't works as I would like.
The closest one was 
(xx)xxxx-xxxxx.I would like to get (xx)xxxx-xxxx when I type the 10th number, and (xx)xxxxx-xxxx when I type the 11th. Is it posible?
9 Answers
2
Ohidul Islam March 8, 2025
This is a comment with code. But it doesn’t works as I would like. The closest one was (xx)xxxx-xxxxx.I would like to get (xx)xxxx-xxxx when I type the 10th number, and (xx)xxxxx-xxxx when I type the 11th. Is it posible?
2
Ohidul Islam March 8, 2025
This is another great news!
1
Ohidul Islam March 8, 2025
Nice
0
Ohidul Islam March 8, 2025
N
0
Ohidul Islam March 8, 2025
Cool!
0
Ohidul Islam March 8, 2025
Cool!
0
Ohidul Islam March 8, 2025
Most important!
-1
Ohidul Islam March 8, 2025
Another!
0
Ohidul Islam March 8, 2025
This is working!