[CustomMasks] How i can use optional digit?

[CustomMasks] How i can use optional digit?

  
Forge Component
(17)
Published on 23 Sep by Pedro Oliveira
17 votes
Published on 23 Sep by Pedro Oliveira
Ex: I can have in my country 9 or 8 digits.

99999-9999 or 9999-9999

tkz
Solution
Hi Diego,

To define some parts in the mask as optional you should use [ ]. So you should choose a MaskText and the MaskDefinition should be "9999[9]-9999".

Thank you for using CustomMasks :)

Solution
I forgot one thing, you should also add to the AdvancedOptions "{greedy: false}".
This component is based on this plugin, you can check it to look for more advanced options.

Cheers
Thank you Sara.

Its work :)

good job