-
Notifications
You must be signed in to change notification settings - Fork 300
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
FAQ - What gets validated when? #200
Comments
I'm having the same issue. I only want callbacks on the view for the attributes that are passed to validate. For example: model.validate({ subject: this.getValue() }) In this code, where "this" is a view widget for the subject attribute, I only expect the Backbone.Validation.callbacks to be called with valid or invalid for just the "subject" attribute. Instead I'm getting called for every attribute on the model. This is a very bad design, assuming that the model has been changed by the view. In my case, it is important that the model is only updated when the "save" button is clicked. I validate each field on blur of the widget. So I want to show errors based on the form values, not the model attributes. |
Check out |
This alternative https://github.com/fantactuka/backbone-validator can do so. |
How to validate just the one's that are set. Is there another method other than model.isValid(true) or model.validate() which would not validates the complete model. Here are some config that is there in my code
setting one attribute with {validate:true} is triggering validate on the entire model
Thanks
The text was updated successfully, but these errors were encountered: