ngx-mask
ngx-mask copied to clipboard
US ZipCode with optional +4
I cannot get this to work for me at all: 00000-0?0?0?0?
My expectations: Input: 12345 Output: 12345
Input: 12345-6789 Output: 12345-6789
Anything else is invalid. Any suggestions?
You can use multiple patterns, per https://github.com/JsDaddy/ngx-mask#dynamic-valid-mask :
<input mask="00000||00000-0000" />
@rlmestre , Dynamic valid mask which version is available from? Because my project still uses Angular 8.
@rlmestre , Dynamic valid mask which version is available from? Because my project still uses Angular 8.
You can use multiple patterns, per https://github.com/JsDaddy/ngx-mask#dynamic-valid-mask :
<input mask="00000||00000-0000" />
It does not work when loading a value like 88888-8888. The mask shows the value as 88888 when preloading.
Thank you. I'll give it a shot.
On Thu, Apr 15, 2021 at 4:50 PM Divjyot Singh Khanuja < @.***> wrote:
@rlmestre https://github.com/rlmestre , Dynamic valid mask which version is available from? Because my project still uses Angular 8.
You can use multiple patterns, per https://github.com/JsDaddy/ngx-mask#dynamic-valid-mask :
It does not work when loading a value like 88888-8888. The mask shows the value as 88888 when preloading.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JsDaddy/ngx-mask/issues/795#issuecomment-820721536, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7H7SJRYTNLLWNMSSSYGNLTI5GQDANCNFSM4QYZQERA .
Thank you. I'll give it a shot. … On Thu, Apr 15, 2021 at 4:50 PM Divjyot Singh Khanuja < @.***> wrote: @rlmestre https://github.com/rlmestre , Dynamic valid mask which version is available from? Because my project still uses Angular 8. You can use multiple patterns, per https://github.com/JsDaddy/ngx-mask#dynamic-valid-mask : It does not work when loading a value like 88888-8888. The mask shows the value as 88888 when preloading. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#795 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7H7SJRYTNLLWNMSSSYGNLTI5GQDANCNFSM4QYZQERA .
I just found the perfect solution to the problem: pattern='^[0-9]{5}(?:[0-9]{4})?$' mask="00000-0000" [validation]="false" [showMaskTyped]="true"
@beaudetious Thanks for your using Ngx-Mask. Please update to latest version. Dynamic mask work as expected.