Reputation: 6239
I'm using KnoockoutJS and the validation plugin from here, https://github.com/ericmbarnard/Knockout-Validation.
By default, validation messages only appear after a field has been modified. The problem is that when the user clicks "Save", I need to validate the bound observable regardless of whether the user has modified the field or not.
I can't seem to find a .Validate()on an obervable...
Upvotes: 0
Views: 1900
Reputation: 924
I use ko.validatedObservable($data)().isValid()
to get whether the viewmodel is false or not.
If there is somebody who knows a better way, please leave a comment :)
Upvotes: 0
Reputation: 1459
Looks like ko.validation.validateObservable
might be what you're looking for... I didn't test it, but that looks like it.
Upvotes: 3