I'm working on a form and I'd like to mask the input of the phone numbers. The plugins what I found aren't okay for me since the area code could be 1 or 2 character long. What I'd like to do is the following: when the user types his number after the first two character the script inserts a space on keyup, then after the next three and later after every fourth character. So when someone types 44444444444 then in the textbox appears 44 44 444 4444. I must check the second group as well, and when someone types there for example 1, the the number must look like: 44 1 444 4444
Is any solution to do that?