<table width="100%" border="1">
<tr>
<td>单价</td>
<td>数量</td>
<td> </td>
</tr>
<tr>
<td><input name="p1" type="text" id="p1" onKeyPress="c1.value=parseInt(this.value)*parseInt(s1.value);z.value=parseInt(c1.value)+parseInt(c2.value)"></td>
<td><input name="s1" type="text" id="s1" onKeyPress="c1.value=parseInt(p1.value)*parseInt(this.value);z.value=parseInt(c1.value)+parseInt(c2.value)"></td>
<td><input name="c1" type="text" id="c1" readonly="1"></td>
</tr>
<tr>
<td><input name="p2" type="text" id="p2" onKeyPress="c2.value=parseInt(this.value)*parseInt(s2.value);z.value=parseInt(c1.value)+parseInt(c2.value)"></td>
<td><input name="s2" type="text" id="s2" onKeyPress="c2.value=parseInt(p2.value)*parseInt(this.value);z.value=parseInt(c1.value)+parseInt(c2.value)"></td>
<td><input name="c2" type="text" id="c2" readonly="1"></td>
</tr>
<tr>
<td colspan="2">合计:</td>
<td><input name="z" type="text" id="z" readonly="1"></td>
</tr>
</table>大概思路
<tr>
<td>单价</td>
<td>数量</td>
<td> </td>
</tr>
<tr>
<td><input name="p1" type="text" id="p1" onKeyPress="c1.value=parseInt(this.value)*parseInt(s1.value);z.value=parseInt(c1.value)+parseInt(c2.value)"></td>
<td><input name="s1" type="text" id="s1" onKeyPress="c1.value=parseInt(p1.value)*parseInt(this.value);z.value=parseInt(c1.value)+parseInt(c2.value)"></td>
<td><input name="c1" type="text" id="c1" readonly="1"></td>
</tr>
<tr>
<td><input name="p2" type="text" id="p2" onKeyPress="c2.value=parseInt(this.value)*parseInt(s2.value);z.value=parseInt(c1.value)+parseInt(c2.value)"></td>
<td><input name="s2" type="text" id="s2" onKeyPress="c2.value=parseInt(p2.value)*parseInt(this.value);z.value=parseInt(c1.value)+parseInt(c2.value)"></td>
<td><input name="c2" type="text" id="c2" readonly="1"></td>
</tr>
<tr>
<td colspan="2">合计:</td>
<td><input name="z" type="text" id="z" readonly="1"></td>
</tr>
</table>大概思路
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货