I'm using Knockout Validation and I'm really struggling to get the fields on my form to only validate after I call save on the whole model. At the moment as the user makes there way through the form, if they enter an invalid value the error displays immediately on blur.
I would like to have it only display after I've clicked my save button, and then re-evaluate each field as the user makes changes after that.
Reduced version of my model below.
var model = ko.validatedObservable({
sellingPrice: ko.observable().extend({
min:0
})
});
function Save(){
if(!model.isValid()){
if (model.errors().length > 0) {
model.errors.showAllMessages(true);
}
return false;
} else {
//save the model
}
}
Is there a flag somewhere I should be setting to defer validation until the whole model has been validated in my save method?