I create a simple model from mapping with knowkoutjs and I want to validate it.
Even if I specify the validation message, the default message is still displayed.
ko.validation.configure({
parseInputAttributes: true
});
var data = { name: "Joe Shmo", email: "joe@shmo.com" };
var validationMapping = {
'name': {
create: function(options) {
return ko.observable(options.data).extend({required: true,message:"name is required"});
}
}
}
var viewModel = ko.validatedObservable(ko.mapping.fromJS(data, validationMapping));
ko.applyBindings(viewModel);
Here is the fiddle
Thanks for your help.
Yoann