igorescobar / jQuery-Mask-Plugin

A jQuery Plugin to make masks on form fields and HTML elements.
http://igorescobar.github.io/jQuery-Mask-Plugin/
Other
4.78k stars 1.42k forks source link

Question on Phone Mask with International numbers #807

Open Light407 opened 3 months ago

Light407 commented 3 months ago

I have a question regarding international numbers.

This library is really good and it works great in MAUI Hybrid which we have found that many libraries fail. So first of all thanks for a great lib!

We are using this to mask phone numbers in typical US formats such as "(###) ###-####" and it works great. The question now is how we can support rare cases when the user wants to enter an international number. Can we somehow detect if a user types a '+' sign and if so simply remove the masking (and if user removes the plus we put back the mask)? We are using this on a regular HTML input field.

Again thank you very much!

pyetrosafe commented 1 month ago

Please, type your examples in both formats you desire.