I'm building some a complex form using Backbone. If I was to categorize the types of views I have I would say I have Model-Views and Collection-Views. Where Model views represent single entity information and collection-views represent repeating forms ( to create multiple Logins for example ).
I am using the model binder plugin for two way binding and the form is working fine however I haven't implemented any client side validation. I was thinking going the model validation route however I realised that the reason I want client side validation is to show messages and inform the user about the more common mistakes and not to actually ensure the integrity of the data, as that is done by the server.
I would be interested in hearing any patterns/ideas as to which approach is good.
I already have jquery validation if this is any help.
My own solution for current project is jQuery.Validate plugin for validating fields and custom Form
view for processing form submit and handling server errors.
Validation plugin is far from perfect in terms of documentation, but once you understand from its source what's happening under the hood, things improve greatly. It's really flexible, gets things done and is easy to extend.
Can't say I'm happy with amount of custom code that has be written for Form
view and overall abstraction level of solution, but this is the best thing I were able to find out for today.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With