Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usa zipcode and placeholder #623

Closed
redka opened this issue Oct 31, 2019 · 2 comments
Closed

usa zipcode and placeholder #623

redka opened this issue Oct 31, 2019 · 2 comments

Comments

@redka
Copy link

redka commented Oct 31, 2019

Hi @NepipenkoIgor. I need add usa zip code too. And now when I add
<input formControlName="zipCode" mask="00000-0?0?0?0?" [showMaskTyped]="true" />

I see this
image

So, why doesn't work this mask?
And I have problem with placeholder. Now it is ____, I want for zip: XXXXX-YYYY
Can you help me?
Thank you)

Originally posted by @redka in #63 (comment)

@redka redka changed the title Hi @NepipenkoIgor. I need add usa zip code too. And now when I add usa zipcode and placeholder Oct 31, 2019
@divjyot3112
Copy link

I've found a solution to this. You can use the following configuration for the mask:
pattern='^[0-9]{5}(?:[0-9]{4})?$'
mask="00000-0000"
[validation]="false"
[showMaskTyped]="true"

@andriikamaldinov1
Copy link
Collaborator

@redka Thanks for your using Ngx-Mask. Please update to latest version.
It example, all work as expected - https://stackblitz.com/edit/angular-vq47a6?file=src%2Fmain.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants