2

I am working with knockout and now i have to work on validation so that
i choose knockout-validation . But as far as i searched on Google ,
i didn't find any tutorial about which i can say that its good
and in fact the problem is that there is not so good documentation of knockout-validation .

I am facing many problems in knockout-validation , like

Implementing conditional validation etc etc.

Any body have link to a good tutorial .

Thanks

4

1 回答 1

3

Google is your only friend here im afraid, but funny you took conditional validation as an example since that is in the docs :D

https://github.com/Knockout-Contrib/Knockout-Validation/wiki/Conditional-Validation

Quick example http://jsfiddle.net/Va2yw/

ViewModel = function() {
    this.validate = ko.observable(true);
    this.required = ko.observable().extend({ required: { onlyIf: this.validate } });
};
于 2013-06-12T08:46:31.977 回答