Skip to content Skip to sidebar Skip to footer

Knockoutjs Validation Binding Value Passed To Custom Binding?

Using KnockoutJS-Validation, I need to pass to a custom binding whether the field passed validation or not. Guessing I need to somehow hook into a KnockoutJS-Validation observable

Solution 1:

The library adds a obserabler isValid to the observable thats extended

http://jsfiddle.net/MCNU8/

var observable = ko.observable("f").extend({ number: true });
console.log(observable.isValid());

Post a Comment for "Knockoutjs Validation Binding Value Passed To Custom Binding?"