Validate Observables Within A Collection Using Knockout Validation
I have a message field and collection of people being bound in an unordered list accompanied each with a drop down list of colors and a default selection. Validation on the message
Solution 1:
Update: With latest version of validation library you can use the live: true option to get it to listen to observableArrays
grouping: { deep:true, observable:true, live:true }
Old answer:
Sadly the group does not get reevaluated when a new item is inserted. Subscribe to the array and do it explicit.
this.items.subscribe(function() {
this.errors = ko.validation.group(this);
this.errors.showAllMessages();
}, this);
Post a Comment for "Validate Observables Within A Collection Using Knockout Validation"