I have a problem very similar to Knockout Validation evaluates immediately on load only the solution presented there doesn't work for me, because I cannot initialize the observable with "" as it is a computed observable with logic in it.
I also tried binding it to the dropdown with:
value: computedObservable()
or:
value: function(){computedObservable}
or:
value: function(){computedObservable}()
instead of:
value: computedObservable
The observable itself is defined as:
viewModel.computedObservable = ko.pureComputed({
write: function (value) {
viewModel.observable(value);
},
read: function () {
return viewModel.isObservableComputed() ? viewModel.existingModel().observable() : viewModel.observable();
}
}).extend({ required: true });
How do I prevent validation on load (it is shown in a bootstrap modal) yet still trigger the validation on a save?