I'm having trouble getting Backbone.Validation to handle complex object validation. per the documentation:
Validating complex objects is also supported. To configure validation rules for objects, use dot notation in the name of the attribute, e.g 'address.street'.
I took the example fiddle and added a complex object but I can't get it to work.
var SignUpModel = Backbone.Model.extend({
defaults: {
terms: false,
gender: '',
},
validation: {
username: {
required: true
},
email: {
required: true,
pattern: 'email'
},
// complex object
'address.zip': {
required: true
},
It looks like the dot notation in the name on the input element because I'm getting this error:
Uncaught Error: Syntax error, unrecognized expression: [name=address.zip]