<table style="border-collapse:separate; border-spacing:0px 10px;">
<tr>
<td align="right">應收現金:</td>
<td><input id="accountReceivable" autoComplete='off'></td>
<td>元,折扣:</td>
<td><input id="vipdiscount" readonly="true"></td>
<td align="right">實收:</td>
<td><input id="receipts" readonly="true"></td>
<td>元 </td>
<td>消費類型:<select id="conType"><option value="1" >報名費</option><option value="2" >酒水零食費</option></select></td>
<td><a id="btnSend" class="easyui-linkbutton">提交</a></td>
</tr>
</table>
$(function(){
$('#accountReceivable').bind('input propertychange', function() {
var a = $('#accountReceivable').val();
var b = $('#vipdiscount').val();
var sum= a * b;
$('#receipts').val(sum);
});
})
效果圖:應收現金每輸入一個數會自動計算並填充到實收的輸入框。css樣式代碼我就不貼出來了,以上代碼能實現實時計算功能就可以了