I need to compare the values and return the message.But the message returned always. How can i do it?
Javascript:
function Calculation() {
var grid = document.getElementById("<%=gvGoodReceived.ClientID%>");
for (var i = 0; i < grid.rows.length - 1; i++) {
var txtcurrentrcvamount = $("input[id*=txtrcvQuantity]")
var cell = $("#gvGoodReceived").find("tr:eq(0)").find("td:eq(2)").text();
}
if (txtcurrentrcvamount > cell) {
alert("Receive quantity must be less or equal PO quantity");
return false;
}
return true;
}
txtcurrentrcvamountappears to be a jQuery object, not a string or number. What is the purpose offorloop?.valueof the element, or using jQuery,.val(). Is the expected result forcellto be the same value at each iteration?txtcurrentrcvamountout from for loop. Everything will be okay.