Backbone.validation, validate without DOM updates

56 Views Asked by At

As expressed in this backbone.validation issue, when using the plugin as shown in this fiddle, we should get a validation performed by isValid() - without params.

If the this.model.attributes have changes, isValid() should validate the properties on this.model.attributes however that's not the case in the example.


What I'm aiming for is to constantly, when there's a change to a the model/form, re-evaluate the validity of the entire form, and based on the outcome enable or disable the submit button (in the fiddle example though, the validation will only happen when clicking the submit button).

I do not want to use isValid(true) because then all fields that have yet not been filled in will get validated by force.

The desired behavior is to validate the dirty fields, but also recognize that the clean fields aren't valid yet (thus not enabling submit button) - but clean fields shouldn't be validated visibly to disturb the user with errors, just under the hood, to enhance the behavior of the submit button.

Am I approaching this problem the wrong way with backbone.validation?

0

There are 0 best solutions below