I would like to use the same alert message to display all the messages at once.
function LoadData(obj) {
var ArrayData = $('input[type="hidden"][id^="li"]').map(function() {
return this.getAttribute("value");
}).get();
$.ajax({
data: {
GUID: JSON.stringify(ArrayData)
},
url: "/LoadOrder/LoadData",
contentType: "application/json; charset=utf-8",
dataType: "json",
cache: false,
success: function(result) {
if (result.length > 0) {
for (var item of result) {
alert("There are problems with your selections ${item.Desc} and ${item.EDesc}
.");
}
}
}
});
}
Expected result should be displayed like below only once.
Currently, the same message displays 3 times.
There are problems with your selections.
ABC - CDE
GFE- Test
Test1 - Test2
Is there any way to display all in once.