我创建了这样的表单:
问题是我无法获得子总计字段的总计。
我尝试创建与总计总计相同的总计字段,但是没有运气。我想知道我是否犯了一个错误,即没有在全局范围内创建一些变量?有没有简单的解决方案可以做到这一点?您可以在这里找到完整的代码:http : //autopartsdiscountcoupons.com/table/Form.html
$("#con_qty116").bind('keyup mouseup', function() {
var rate = 40;
var qty = $("#con_qty116").val();
var val = qty * rate;
$("#con_qty116_td").text(val);
sub_total_of_weather_sheild();
});
$("#con_qty117").bind('keyup mouseup', function() {
var rate = 160;
var qty = $("#con_qty117").val();
var val = qty * rate;
$("#con_qty117_td").text(val);
sub_total_of_decorative_surface();
});
function sub_total_of_weather_sheild() {
var td116 = parseInt($("#con_qty116_td").text());
var sub_tot = td116;
$("#weather_sheild_qty_sub_total").text(sub_tot);
gr_total(sub_tot);
}
function sub_total_of_decorative_surface() {
var td117 = parseInt($("#con_qty117_td").text());
var sub_tot = td117;
$("#decorative_surface_qty_sub_total").text(sub_tot);
}
<td>116</td>
<td>Provide and apply Weathershield (Reputable Brand) minimum...
</td>
<td>Sft</td>
<td><input id="con_qty116" name="con_qty116" type="number" /></td>
<td>40</td>
<td id="con_qty116_td">0</td>
<th colspan="4">Sub Total</th>
<td id="weather_sheild_qty_sub_total" colspan="2">0</td>
<td>117</td>
<td>Color Crete min 4mm thickness including surface preparation applied on prepared surface using Applicant Machine/Gun
</td>
<td>Sft</td>
<td><input id="con_qty117" name="con_qty117" type="number" /></td>
<td>160</td>
<td id="con_qty117_td">0</td>
</tr>
<tr>
<th colspan="4">Sub Total</th>
<td id="decorative_surface_qty_sub_total" colspan="2">0</td>
</tr>
<th colspan="4">Grand Total</th>
<th colspan="2" id="grand_total">0</th>
慕娘9325324
相关分类