I have json object
{"errorType":"ValidationError","message":null,"errors":[{"message":"may not be empty"},{"message":"may not be empty"},{"message":"may not be empty"}]}
at the ajax error call back function.
function makeAjaxCall(){
var send =serializeObject($("#employee"));
send = JSON.stringify(send);
$.ajax({
url: '/RestFul-Employee/addEmployee',
type: 'POST',
dataType: "json", // Accepts
data:send,
contentType : "application/json",
success: function(result) {
alert("success");
},
error: function(error){
//so form validation error in form
}
});
}
I need parse all form error message and show them in a form. I can not parse the error messages. Could you please help me?