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

custom validation method overides built-in ones when using toghether #316

Open
dbleyenda opened this issue Oct 26, 2015 · 1 comment
Open

Comments

@dbleyenda
Copy link

I have a question that maybe someone can help me, or at least tell me if this is a bug.

I have some validation rules applied to a model that uses some built-in validation methods. At the moment, this works fine.

I was asked to add a new validation (line 15 in the JSFiddle), which is needed as a custom method. The weird thing is that when I added the custom method, the built in ones stop working.

Here is a JSFiddle with the working case: https://jsfiddle.net/jy4784yo/2/

To test: Try leaving empty the input and click the "add" button, you will notice that an alert prompts "model is valid", not entering in the required true rule. In the other hand, if you comment the line 15 in the JSFiddle, and try adding an empty value, it will enter in the previous validations.

Any clues why?

I have already tried updating versions of underscore / backbone / backbone.validation in my code, but it also doesn't work (I'm using those versions because the app I'm working on uses those).

One thing that I'm wondering is if the expected scenario of the custom validation method is to override others. I'm pretty sure it is not.

Thanks in advance.

@russplaysguitar
Copy link

👍

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