嗨,我有以下输入,它获取值并调用函数 fntotal 来显示总数。更改值时代码可以正常工作。但是,当在表单中加载值时,它不会显示总数。
<input type="textssr" name="s{{=id}}" id="{{=id}}" value='{{=sAmount}}'
onchange="fntotal(this.form)" />
function fntotal(formObj) {
var total = 0;
total += parseInt(formObj.test1.value, 10)
total += parseInt(formObj.test2.value, 10)
total += parseInt(formObj.test3.value, 10)
total += parseInt(formObj.s1020.value, 10)
formObj.sum.value = total
}
我需要什么才能让输入显示表单加载和 onchange 的总数?请帮忙谢谢