I'm using knockout validation plugin. I have a few validation rules for my observable. Is it possible to define which rule failed during the validation?
I tried to use method rules(), but it just returns list of the attached rules, but not a state of the some rule (failed or not):
https://i.stack.imgur.com/5q8Gw.png
I've extended observable in this way:
self.SomeField = ko.observable().extend({
required: {
message: "The field is required.",
params: true
},
maxLength: {
message: "Please enter no more than 300 characters.",
params: 300
}
});
My not validated observable looks like:
https://i.stack.imgur.com/y95Yn.png
Thank you.