function in function in function calls uncaught error: maximum call stack
exceeds
im having a problem with my code in jquery when im calling my function
from function from function it shows a loop alert message and an error
saying "uncaught error: maximum stack calls exceed."
here's my code:
$("#AvailabilityForm").on('submit', function (e)
{
var gvDetDDLs =
$('#availabilityGrid').find("input[name=dllEditAvailableDay]");
$.each(gvDetDDLs, function () {
var duplicateExists = false;
var ddlDay = $("#dllAvailableDay option:selected").text();
var currVal = $(this).val();
gvDetDDLs.not(this).each(function () {
e.stopPropagation();
if (ddlDay == currVal) {
duplicateExists = true;
alert("Duplicate entry is not allowed");
$(this).focus();
return false;
}
}
);
}
);
return true;
}
);
my scenario is i want to put a message when you click submit button and it
will not save to prevent duplicate entry.
kindly help me with this problem???
thanks
No comments:
Post a Comment