Am using AJAX code whereby I handle errors form the backend code.. All is working well except that I want to alert the errors individually to the user in a numbered list
Expected Output
1. Please insert a valid phone number
2. Please insert your email
3. Please insert a valid passport number
AJAX code handling errors
error: function(data) {
//Unblock the spinner
$.unblockUI();
var errors = '';
for(datos in data.responseJSON){
errors += data.responseJSON[datos] + '<br>';
}
//Alert each error individually
alert(errors);
}