Hello,
I have an MVC application that uses the Grid control. I have configured .NET DataAnnotations, which includes error messages, and it is working. When there is a data entry validation error, Javascript displays my error message(s). The issue that I have is that each message that is displayed does not tell me the name of the field that has invalid data. The following is the Javascript function that Kendo uses in its examples. I can't find details as how to add the field name to the message that is displayed. I hope that someone can help me.
Thanks,
Mike
I have an MVC application that uses the Grid control. I have configured .NET DataAnnotations, which includes error messages, and it is working. When there is a data entry validation error, Javascript displays my error message(s). The issue that I have is that each message that is displayed does not tell me the name of the field that has invalid data. The following is the Javascript function that Kendo uses in its examples. I can't find details as how to add the field name to the message that is displayed. I hope that someone can help me.
Thanks,
Mike
function error(e) {
if (e.errors) {
var message = "Errors:\n";
$.each(e.errors, function (key, value) {
if ('errors' in value) {
$.each(value.errors, function () {
message += this + "\n";
});
}
});
alert(message);
}
}
</script>