Skip to content
New issue

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

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

Already on GitHub? # to your account

Is there a way to limit input chars? #680

Open
saleh-esmaili opened this issue Jan 18, 2022 · 1 comment
Open

Is there a way to limit input chars? #680

saleh-esmaili opened this issue Jan 18, 2022 · 1 comment

Comments

@saleh-esmaili
Copy link

Hi, I am trying to make an input that user can only enter these charecters: X, Y, Z, 0 to 9, +, -, *, /, %.
What should I do?

@stripedpurple
Copy link

As far as I know cleave does not support your specific need. However you can use the HTML5 pattern attribute to validate the input.

<input name="name" pattern="^[XYZ0-9\+\-\*\/\%]+$"/>

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants