There is already a library for doing validation in Knockout, aply named Knockout-Validation. I don't really remember what issues I ran into when I used it so long ago, but I remember giving up on it. It also doesn't appear to play well with RequireJS, which is critical if you work in Durandal as I do.