28,390
社区成员
发帖
与我相关
我的任务
分享
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
function updateTotal() {
var form = document.myform;
var a = ['explain', 'kucun', 'zujie'], sum = 0;
for (var i=0; i<a.length; i++) {
sum += parseInt($.trim(form[a[i]].value), 10) || 0;
}
form.zongshu.value = sum;
}
$(document).on('change', updateTotal);
$(document).on('input', updateTotal);
</script>
<form method="post" name="myform" action="Admin_ClothesAdd.asp?mark=Clothes">
<td height="230"><div align="center">
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr bgcolor="#ECF5FF">
<td width="27%" height="60" align="center">
<div align="center" style="height:15px;">服装名称</div>
<div align="center" style="height:15px;">库存数量</div>
<div align="center" style="height:15px;">租借数量</div>
<div align="center" style="height:15px;">服装总数</div></td>
<td width="73%">
<input name="explain" type="text" value="" size="40">
<input name="kucun" type="text" value="" size="40">
<input name="zujie" type="text" value="" size="40">
<input name="zongshu" type="text" value="" size="40">