I want to set the message to display in the validation function of knockout similar to whats going on here: Knockout Validation Plugin Custom Error Message but without async.
Heres what ive tried, but no validation message is displayed.
this.name = ko.observable().extend({
validation: {
validator: function (val) {
return { isValid:val === 'a', message: 'the value ' + val + ' is not a' };
},
message: 'I dont want this default message'
}
});
JSFiddle
is there a good way to do this?