I'm working on a Durandal JS SPA application, and I wish to use Knockout Validation.
The problem is that validation is being triggered on page load, which is not what I want - I'd like to trigger the validation myself.
I have tried using
ko.validation.init({
registerExtenders: true,
messagesOnModified: true,
insertMessages: false
});
as well as ko.validation.configure with the same parameters, followed by ko.validation.init();
Here is a snippet of my viewmodel.
function ViewModel(){
var self = this;
self.username = ko.observable().extend({
required: true
});
self.errors = ko.validation.group(self);
}
I also tried delaying the call to ko.validation.group(self) till a button is clicked, but then it wont validate at all.