We’re using Knockout.js and the Knockout-validation plugin.
When a user returns to a page that has validation errors, we want the error messages to display. Does anyone know if it’s possible to trigger knockout validation without actually changing the bound answer?
We’re using Knockout.js and the Knockout-validation plugin. When a user returns to a page
Share
The solution is to call showAllMessages. If the view model has nested observables, be sure to set ko.validation.configure to use deep grouping because the default value is false.
Example:
Alternatively, you can replace
!viewModel.isValid()withresult().length > 0