这个TAB是可以批量处理,可以随意新增一行或删除一行,主要代码如下:
<table id="1">
<tr >
<td nowrap="true">删除</td>
<td nowrap="true">产品</td>
<td nowrap="true">折扣</td>
<td nowrap="true">优惠价</td>
<td nowrap="true">数量</td>
<td nowrap="true">总金额</td>
<td nowrap="true">备注</td>
</tr>
<tr type="data">
<td nowrap="true"><span><input type="text" name="PRODID" value="" nullable="0" itemdesc="产品" />
</td>
<td nowrap="true"><span><input type="text" name="DISCOUNT" value="" nullable="0" itemdesc="折扣" />
</td>
<td nowrap="true"><span><input type="text" name="PRICE" value="" nullable="0" itemdesc="优惠价" />
</td>
<td nowrap="true"><span><input type="text" name="COUNT" value="" itemdesc="数量" onchange=getTotalPrice(this)/></span>
</td>
<td nowrap="true"><span><input type="text" name="TOTALPRICE" value="" itemdesc="总金额"/>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input id="1" class="button" type="button" value="增加" onclick="。。。。">
</td>
<tr>
</table>
我现在想做的是,在每一行修改数量COUNT的时候,触发一个onchange的事件(见上面代码),这个事件可以根据当前COUNT的值和PRICE的值,计算得到TOTALPRICE的值,并付给改行的TOTALPRICE。
请问这个onchange事件的js该怎么写?
先给15分,如果比较满意,将追加30分
一楼的回答太繁琐
二楼的回答不可行(我当前页面不仅这一个table,还有其他table,其他table里也有input标签)
跪求javascript高手,帮帮忙!!!!!!