[讨论]有一表格中删除某行后其合计值却未相应减少或减少不正确
下面是此表格的代码,参与讨论时可运行此代码试试看,同时请高手帮助解决一下合计不正确问题。
<table width="760" border="0" cellspacing="1" cellpadding="0" class="tb" id="tlist">
<tr class="tit2" align='center'>
<td>ITEM NO </td> <td>ITEM DESCRIPTION </td> <td>QTY </td> <td>PRICE </td> <td>INNER </td> <td>OUTER </td> <td>TOTAL </td> <td>REMARKS </td> <td>操作 </td>
</tr>
</table>
<table width="760" border="0" cellspacing="1" cellpadding="0" class="tb" id="tlist">
<script language="JavaScript">
function check_all(obj){
for(i=0;i<document.getElementsByName("c").length;i++){
document.getElementsByName("c")[i].checked=obj.checked;
}
}
</script>
<tr class="tit1" align='center'>
<td> <input type="text" id="fno1" name="fno1" size=12 maxlength=12 value='01'> </td>
<td> <input type="text" id="fdesc1" name="fdesc1" size=32 value='television'> </td>
<td> <input type="text" id="fqty1" name="fqty1" size=7 maxlength=7 value='238' onchange='chtotal(1);'> </td>
<td> <input type="text" id="fprice1" name="fprice1" size=6 maxlength=6 value='0' onchange='chtotal(1);'> </td>
<td> <input type="text" id="finners1" name="finners1" size=4 maxlength=4> </td>
<td> <input type="text" id="fouters1" name="fouters1" size=4 maxlength=4> </td>
<td> <input type="text" id="ftotal1" name="ftotal1" size=8 readonly > </td>
<td> <input type="text" id="fremarks1" name="fremarks1" size=20 maxlength=100> </td>
<td> <input type="button" value="删除" id='delbutton1' onclick="delrecord(this);"> </td>
</tr>
<tr class="tit2" align='center'>
<td> <input type="text" id="fno2" name="fno2" size=12 maxlength=12 value='02'> </td>
<td> <input type="text" id="fdesc2" name="fdesc2" size=32 value='radio'> </td>
<td> <input type="text" id="fqty2" name="fqty2" size=7 maxlength=7 value='138' onchange='chtotal(2);'> </td>
<td> <input type="text" id="fprice2" name="fprice2" size=6 maxlength=6 value='0' onchange='chtotal(2);'> </td>
<td> <input type="text" id="finners2" name="finners2" size=4 maxlength=4> </td>
<td> <input type="text" id="fouters2" name="fouters2" size=4 maxlength=4> </td>
<td> <input type="text" id="ftotal2" name="ftotal2" size=8 readonly > </td>
<td> <input type="text" id="fremarks2" name="fremark