i have a table and I need to bulk updation. Before I need to check one column have no null value and the values are unique.So i loop the table.But how can i exit from the loop when same values appear in table?
i checked is there any null field.But after i cant exit from the loop where i checked unique values
when duplicate value occur i need to show in countDuplicate the row count of table.
if (NullField==false)
{
$('#tblClassName tbody tr').each(function (i, item)
{
countDuplicate = parseInt(countDuplicate + 1);
$.ajax({
type: "POST",
url: "@Url.Action("IsAdmissionNumbervalid", "StudentDetailUpdation")",
data: JSON.stringify({
AdmissionNo:
$($(this).find("#txtAdmissionNumber")).val(),
FieldName: $("#ddlField option:selected").val(),
StudentID: $(this).find(".txtStudentID").html(),
}),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
if (response == "Failed") {
IsduplicateExist = true;
alert("Admission Number already exists");
return false;
}
}
})
if (IsduplicateExist == true) {
return false;
}
})
}
alert($('#tblClassName tbody tr').length)
alert(countDuplicate)