#3448 - Suggested Formatting For Optional Extensions
I want to have a mask that allows for an optional extension. How can I accomplish this? I've tried "(999) 999-9999, x " which doesn't allow for an extension after the x. I've also tried "(999) 999-9999, x 99999" which requires the digits after the x. How can this be made as optional please? Thanks!
6 years ago
Hello,
Sorry for the delai, but yes, it is possible to have multiple masks for one field, that validate the field. The mask to use, in your case, is like follows:
((999) 999-9999)|(99999)
The module will display as default the first mask, but will automatically change to the second one when it detects that the entered value does not validate the first mask anymore but validates the second one. The different masks have to be between paranthesis and separated by the pipe symbol "|".
If you have any questions, i'll be glad to help.
Kind regards, Synolia Support
6 years ago
Hello. This is what I've decided to go with ((999) 999-9999)|(, x 99999) The digit lengths of extensions vary greatly. Is there a way to make the digit length variable? Or will our users just need to add leading zeroes of the extension is less than 5 digits? ex; (123) 456-7891, x 00012
6 years ago
Hello,
You can add as many masks as you want. So you can for exemple have something like this:
((999) 999-9999)|(, x 99999)|(, x 9999)|(, x 999)|(, x 99)
For shorter phone numbers. Normally the above mask will validate the "x 12" and the "x 00012" as well.
If you have any assistance, i'll be glad to help.
Kind regards, Synolia Support
6 years ago
After some trial and error, I got this to work the way we wanted with the following mask. Thanks for getting me going in the right direction: ((999) 999-9999)|((999) 999-9999, x 9)|((999) 999-9999, x 99)|((999) 999-9999, x 999)|((999) 999-9999, x 9999)|((999) 999-9999, x 99999)
6 years ago
Hello,
I'm glad you found the right mask for your situation. Do you require any further assistance with this issue?
Kind regards, Synolia Support
6 years ago
We are all set, thanks.