I am not sure if this is possible, but I have a scenario where I have a validation system which notifies my validation system when something has become valid/invalid via a d
On your computed observable (isValid
) you can call notifySubscribers(currentValue)
, which will notify any subscribers with the current value. It will not re-evaluate the computed and will simply notify subscribers with the current value.
Add binding enable: formValid
where formValid = ko.computed(return true if all values are valid)
to submit button. This way user can not submit until form is filled properly.
Use ko.validation.validateObservable(yourDependentObservable)
to revalidate field manually
or use yourObsevable.notifySubscribers()
if yourDependentObservable
depends on yourObservable
.