spent a ton of time trying to get this to work... followed this example with modifications i made...
var MyForm = new Backbone.Form({
schema: {
title: { type: 'Select', options: ['Mr', 'Mrs', 'Ms'] },
name: 'Text',
email: { validators: ['required', 'email'] },
address: { type: 'List', itemType: 'Object',
subSchema: {
street: { type: 'Text' },
zip: { type: 'Number' },
country: { 'Select', options: ['USA', 'UK'] }
}}
});
MyForm.on('name:change', function(form, nameEditor) {
console.log(nameEditor.getValue()); // works!
});
MyForm.on('zip:change', function(form, zipEditor) {
console.log('Zip changed to "' + zipEditor.getValue() + '".'); // does not work!
});
how do i get events from the subschema in the main code?
thanks!