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 custom call back function with multi parameter #171

Open
chaosthunder opened this issue Feb 13, 2016 · 1 comment
Open

Allow custom call back function with multi parameter #171

chaosthunder opened this issue Feb 13, 2016 · 1 comment

Comments

@chaosthunder
Copy link

Hi Rick Harrison,

Thanks for your validate.js library. It helped us a lot.

And here is my issue: I need to check multi fields for each other:

Ex: min & max fields.
check_minmax(min, max) {
return (min < max);
}

But your callback register only allows 1 parameter.

I want to be able to call back like

validator.registerCallback('check_minmax', function(value1, value2) {
return (value1 < value2);
});

Can you extend the validate.js so that someone has a way to register multi fields check.

Thank you!

@rickharrison
Copy link
Owner

Hello, thanks for the suggestion. If you could try adding this and submit a pull request, it would be much appreciated!

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