kmalakoff/knockback — Issue #13: Validations
Author: kmalakoff
Created: 2011-11-06 13:13:46+00:00
State: open

I just pinged one of the authors of Backbone.Validation (https://github.com/n-time/backbone.validation), but it looks like there are two solutions:

1) https://github.com/n-time/backbone.validation
2) https://github.com/thedersen/backbone.validation

I think it would be good to support bindings or hooks for validations, but I haven't given much thought to how and if we can support one or both libraries or any library.

Either way, there are a few design points I would want to consider in any solution:

1) The bindings for display of validations state should be up to the user of the library - given the flexibility of Knockout bindings we shouldn't need to hard code labels or classes like in jquery validate (http://bassistance.de/jquery-plugins/jquery-plugin-validation/) but leave it up to the user to display how they want. Although do we want a default implementation? (if so, we should keep it decoupled from jquery, MooTools, etc?)

2) The user should be able to hook in any rules solution they want (like kb.LocalizedObservor). I'm not sure about this one, maybe we should choose one solution to make it work out of the box. Thoughts?

3) Async/ajax validations - I use a Mobile Couchbase view to query for unique names, then process the returned rows differently depending if it is a new or existing model, so I like to see if fit my use case!

Anyone want to write a proof of concept? or to make a proposal? ;-)