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

Allow numbers, chars and hyphens #1

Open
erickmendezz opened this issue Dec 26, 2024 · 0 comments
Open

Allow numbers, chars and hyphens #1

erickmendezz opened this issue Dec 26, 2024 · 0 comments

Comments

@erickmendezz
Copy link

erickmendezz commented Dec 26, 2024

Hi,

I'm trying to solve this using a library, and I need to validate various Document Numbers (Doc. Nums.). These numbers can contain numbers, characters, and hyphens (-).

I'm currently using:

VMasker(document.getElementById("my-doc")).maskPattern('9999 9999-9');

However, this is not accepting characters like hyphens (-).

The challenge is that these Doc. Nums. originate from different countries, so there isn't a single, specific mask that will work for all of them.

I want to validate formats like these:

A9B9-C9D9-W9Y9-Z
Z9-9B99-9C99-E9
9C99D9-9Y99W9-99
and other variations.
Essentially, I only need to allow numbers, characters, and hyphens.

Could anyone assist me with this?

@erickmendezz erickmendezz changed the title Allow hyphens Allow numbers, chars and hyphens Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant