Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

knockout-validation plugin, get isValid from specific property

Is is possible to see if just one property is valid in the knockout-validation plugin?

I could not see any reference to it in the documentation, only the ability to see if the whole model is valid.

For example I wish a computed observable to have a different value depending upon if another observable is valid.

like image 714
Alex KeySmith Avatar asked Feb 08 '13 16:02

Alex KeySmith


1 Answers

I was being led down the wrong direction, as I was using async validators and over complicated my problem, I think it is as simple as:

propertyName.isValid();

e.g.

self.email.isValid();

like image 96
Alex KeySmith Avatar answered Sep 21 '22 15:09

Alex KeySmith