Code:
<script type="text/javascript">
function submitForm(form,newAction) {
    form.action = newAction + "";
    form.submit();                  
}
function calc(idx) {
	
  var price = parseFloat(document.getElementById("cost"+idx).value)*
              parseFloat(document.getElementById("qty"+idx).value);
			  
			  
			  document.getElementById("price"+idx).value= isNaN(price)?"0.00":price.toFixed(2);
			  
			  
			  var table = document.getElementById("dataTable");
			  
		      var rowCount = table.rows.length;
				var s=rowCount-1;

			for (var i=1;i<=s;i++) {
				var total=0;
				
				  var e = parseFloat(document.getElementById("price"+i).value);
				
				    total += isNaN(e)?0:e;
			  }
			 
			 document.getElementById("total").value=isNaN(total)?"0.00":total.toFixed(2);  
   
}


    function deleteRow(tableID) {
        try {
        var table = document.getElementById(tableID);
        var rowCount = table.rows.length;

        for(var i=0; i<rowCount; i++) {
            var row = table.rows[i];
            var chkbox = row.cells[0].childNodes[0];
            if(null != chkbox && true == chkbox.checked) {
                table.deleteRow(i);
                rowCount--;
                i--;
            }


        }
        }catch(e) {
            alert(e);
        }
    }
</script>
HTML Code:
<c:forEach items="${inlist.invoicelist}" var="addin" varStatus="status">
                <TR>
                    
                    <TD width="2px">${status.count}</TD>
                    
                    <TD><select name="invoicelist[${status.index}].drug" onChange="submitForm(this.form,'findmedicine')" >
					<option value="0">--Please Select--</option>
					<c:if test="${!empty druglist}">
					<c:forEach items="${druglist}" var="druglist">
							<option value="${druglist.mid}" <c:if test="${druglist.mid eq addin.drug}"> selected="selected" </c:if> >${druglist.medicine}</option>		
					</c:forEach>
					</c:if>
					
			  </select>
			                      <TD> <input   name="invoicelist[${status.index}].rate" id="cost<c:out value="${status.index}"/>" size="16"  value="${addin.rate}" onkeyup="calc('${status.index}')"/></TD>
			  
                    <TD> <input  name="invoicelist[${status.index}].quantity"   id="qty<c:out value="${status.index}"/>" size="16" value="${addin.quantity}" onkeyup="calc('${status.index}')"/> </TD>
                    <TD> <input   name="invoicelist[${status.index}].netamount" id="price<c:out value="${status.index}"/>" size="16" value="${addin.netamount}"/>
                  <input type="hidden"  name="invoicelist[${status.index}].id"  size="16" value="${addin.id}"/>
               <td><a href="reomoveitemnew?id=${addin.id}&invoiceid=${invoice.invoiceid}"><img src="../../images/damage.jpg" width="10" height="10" /></a></td>

                </TR>
</c:forEach>
i call this java script in on key up " <input name="invoicelist[${status.index}].quantity" id="qty<cut value="${status.index}"/>" size="16" value="${addin.quantity}" onkeyup="calc('${status.index}')"/> "

but this not working for total amount only
plz give me the good replay friends

thank you