我使用两个文本框来求和数字但显示错误..
<script>
function getPrice(tMaking, tHandeling, tTotal) {
var obj_tMaking = document.getElementById(txtMaking_F)
var obj_tHandeling = document.getElementById(txtHandeling_F)
var obj_tTotal = document.getElementById(txtTotal_F)
if (obj_tMaking.value != "" && obj_tHandeling.value != "") {
obj_tTotal.value = parseInt(obj_tMaking.value) + parseInt(obj_tHandeling.value);
}
else {
obj_tTotal.value = "";
}
}
</script>
</head>
<body>
<input name="grdView$ctl08$txtMaking_F" type="text" id="grdView_ctl08_txtMaking_F" class="classMaking" onchange="javascript:return getPrice('grdView_ctl08_txtMaking_F','grdView_ctl08_txtHandeling_F','grdView_ctl08_txtTotal_F');" style="width: 60px;" />
<input name="grdView$ctl08$txtHandeling_F" type="text" id="grdView_ctl08_txtHandeling_F" class="classHandling" onchange="javascript:return getPrice('grdView_ctl08_txtMaking_F','grdView_ctl08_txtHandeling_F','grdView_ctl08_txtTotal_F');" style="width: 60px;" />
<input name="grdView$ctl08$txtTotal_F" type="text" id="grdView_ctl08_txtTotal_F" class="classTotal" style="width: 100px;" />
</body>