首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

请教高手:用javascript如何改变TextBox的值

2012-01-05 
请问高手:用javascript怎么改变TextBox的值?我在页面放的都是 asp:TextBox 控件,我想实现的作用是:根据

请问高手:用javascript怎么改变TextBox的值?
我在页面放的都是 <asp:TextBox> 控件,我想实现的作用是:根据用户在txtPrice1、txtMemberPrice、txtMemberPrice这三个控件输入的值确定txtPrice2和txtPrice3的值并由脚本将这个值雨填入txtPrice2和txtPrice3控件中。
下面是脚本,请高手指正:
function   rebate()
{
        var   marketPrice=document.getElementById( " <%=txtPrice1.ClientID   %> ").value;
        var   memberPriceRebate=document.getElementById( " <%=txtMemberPrice.ClientID   %> ").value;
        var   dealerPriceRebate=document.getElementById( " <%=txtDealerPrice.ClientID   %> ").value;
        txtPrice2.value=memberPriceRebate*marketPrice/100;
        txtPrice3.value=dealerPriceRebate*marketPrice/100;
}

[解决办法]
document.getElementById( " <%=txtPrice2.ClientID %> ").value 不行的话 就用
document.getElementById( " <%=txtPrice2.ClientID %> ").innerText
首先必须考虑类型转化问题

热点排行