Or, is there a way to pick and choose fields from my View Model and put them in their own validation group (but keep them in the larger group as well)?
Yes, you can define as many groups as you want; and observables can be in multiple validation groups.
So, for example, let's say your validation group for all of the errors in your view model is the following:
ViewModel.errors = ko.validation.group(ViewModel);
You can also add individual groups like this:
ViewModel.saveErrors = ko.validation.group([ViewModel.requiredForSave1, ViewModel.requiredForSave2]);
Also, by calling showAllMessages
on a validation group you are only showing the messages for the observables within that group. ViewModel.saveErrors.showAllMessages()
will only show the validation messages for requiredForSave1
and requiredForSave2
Hope that helps