Skip to content

Changed order of validators #640

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

Closed
wants to merge 1 commit into from

Conversation

hardchor
Copy link

... to allow more general validators (number, date) to be executed before more specific ones (min, max, range).

The original issue was that I've attached a number of validators to a field like so:

<input type="text" id="some-value" name="some-value" data-rule-required="true" data-rule-number="true" data-rule-min="1" data-rule-max="5">

Since the validators are being checked against sequentially, the min and max validators kick in before the number validator. An example where this becomes obvious is when I enter "a" into the input field and it displays an error that the minimum input is 1 (rather than telling me that it's not a number).

@jzaefferer
Copy link
Collaborator

Thanks! I've fixed the indentation (should be tabs) to land this.

@hardchor
Copy link
Author

Ah, sorry about this. Coding standards here are to use spaces, guess my IDE "fixed" this ;)

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

Successfully merging this pull request may close these issues.

3 participants