Reputation: 2946
I'm trying to validat the fields in the following form structure with knockout.validation.
form body:
static fields (observables)
field_container:(observableArray)
n dynamic fields (observables)
Here's a simple implementation at jsfiddle. http://jsfiddle.net/D6Ltg/4/ I can validate the static fields upon calling errors.showAllMessages, but dynamic fields are not validated. How can i validate the observables in observableArray?
Edit: RTFM: https://github.com/ericmbarnard/Knockout-Validation/wiki/Configuration Adding grouping : {deep: true} to configuration makes all the nested structures validatable too.
Upvotes: 3
Views: 4652
Reputation: 2946
The solution i found is to walk through the observablearray elements, validating each one manually. I've modified the jsfiddle code accordingly. http://jsfiddle.net/D6Ltg/7/
Upvotes: 3