function calculateamount() {
var txtTotal = 0;
var passed = false;
total = 0.00;
var id = 0;
totalDTH = 0.00;
totalMCF = 0;
var grid = document.getElementById("<%= GridView1.ClientID%>");
var inputs = grid.getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].name.indexOf("lbl_amt") > 1) {
if (inputs[i].value != "") {
totalDTH = totalDTH + MathRound(parseFloat(inputs[i].value));
}
}
}
document.getElementById("<%= txtamttotal.ClientID %>").value = MathRound(totalDTH);
}
if (inputs[i].name.indexOf("lbl_amt") > 1) // You should use here textbox of price which is in gridview.
call calculateamount() function on keyup or onblur
please vote if it helps you thanks