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

Can you add multiple validators? #9

Open
Tundus opened this issue Apr 19, 2023 · 2 comments
Open

Can you add multiple validators? #9

Tundus opened this issue Apr 19, 2023 · 2 comments

Comments

@Tundus
Copy link

Tundus commented Apr 19, 2023

Hi,

I would like to ask if you can use complex validator expressions for instance I would like to check if the value is numeric or is hyphen? If yes how a code example would look like?

Many thanks,

Tundus

@unwild
Copy link
Owner

unwild commented Apr 19, 2023

Hi,

You would have to call multiple validation function inside the validation function.

Ex: validation: (val) => { return $.isNumeric(val) || containsHyphen(val) }

Or do your own custom validation function for numeric values ( validation: validate) and check everything in your validate function. You could use something like https://stackoverflow.com/a/9716488/12748655

@Tundus
Copy link
Author

Tundus commented Apr 19, 2023

Thank you so much! This was very helpful! Many thanks!

Repository owner deleted a comment from devsquadcore Mar 14, 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

2 participants