当前位置: 代码迷 >> ASP.NET >> javascript 控件数据没有更新,该如何处理
  详细解决方案

javascript 控件数据没有更新,该如何处理

热度:956   发布时间:2013-02-26 00:00:00.0
javascript 控件数据没有更新
使用javascript求和,UltraWebTab2__ctl1_txtCstmeChrgbckTotal控件上已有数据,要将计算结果更新到控件上,多次触发事件,第一次提示原有数据,第二次是计算结果,但页面控件上显示仍是原有数据。
以下是我的代码,请大虾帮忙看看是那里不对。
var   cstmLaborCosts   =   document.getElementById "UltraWebTab2__ctl1_txtcstmLaborCosts ").value;
var   cstmFreightCosts   =   document.getElementById "UltraWebTab2__ctl1_txtcstmFreightCosts ").value;
var   cstmOtherCosts   =   document.getElementById( "UltraWebTab2__ctl1_txtcstmOtherCosts ").value;

alert(document.getElementById( "UltraWebTab2__ctl1_txtCstmeChrgbckTotal ").value);

document.getElementById( "UltraWebTab2__ctl1_txtCstmeChrgbckTotal ").innerText   =   Number(cstmLaborCosts)   +   Number(cstmFreightCosts)   +   Number(cstmOtherCosts);


------解决方案--------------------------------------------------------
检查js的运行时机。
------解决方案--------------------------------------------------------
写的不太全,没看懂
但帮楼主顶下!
------解决方案--------------------------------------------------------
运行js时请多多注意把IE临时文件删除!!!!!!!!!!
  相关解决方案