用jQuery 实现表单数据的统计可新增多行

2014-11-24 10:44:14 ? 作者: ? 浏览: 0





无标题文档




<script type="text/java script" src="js/jquery.min.js">
<script type="text/java script">
$(function(){
$("#add").click(function(){
$("#total").before(" 删除此行 "); });

$("a[href='#']").die().live('click',function(){
$(this).parents(".info").remove();
//alert($(this).attr("id"));
});

$('.item').die().live('focusout',function(){
var temp = 0;
var id = parseInt($(this).attr('id'));

$("input[id="+id+"]").each(function(){
//alert(id);
temp+= parseFloat($(this).val());
//alert($(this).val());
})
//alert(temp);
var totalItem = "totalItem"+id;
$("."+totalItem).val(temp);
var totalMoneyItem = "totalMoneyItem"+id;
var itemPrice = "item"+id+"Price";
$("."+totalMoneyItem).val(temp*parseFloat($("."+itemPrice).val()));
var temp = 0;
});
$(".totalMoney").bind('click',function(){
$i=0;
$totalMoneys = 0;
for(var i=1;i<=7; i++){
$tempT = "totalMoneyItem"+i;
$totalMoneys+=parseFloat($("."+$tempT).val());
}
$(".totalMoney").val($totalMoneys);
$(".alredyPay").val(($totalMoneys*0.7).toFixed(4));
})

});






经费管理>>>工程进度款申请单






































































































工程进度款申请单

项目名称 中继段落 工 作 量(千米) 总金额 备注
附挂光缆 直埋光缆 布放管道 新建管道 新建杆路光缆

旧杆路增吊

墙壁敷设光缆 新立光交箱
删除此行
总工程价  
单价  
总金额
付款                
已付金额
本次需求支付金额(元)
请款人账号

    申 请 人  


















出纳:
总经理:
会计:
办公室主任:
工作量统计员:
部门经理:
   










-->

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: