显示textbox的时候用什么方法,不刷新页面????急!!

解决方案 »

  1.   

    DropDownList设置一下就行了 
    就是走服务器
      

  2.   

    js代码就可以实现
    document.getElementByID("textbox").value = document.getElementByID("drop1").value + document.getElementByID("drop2").value * document.getElementByID("drop3").value / document.getElementByID("drop4").value;
      

  3.   


    <script language="javascript">
    function gettotal()
    {
    var a=Number(document.getElementById('下拉框1').value);
    var b=Number(document.getElementById('下拉框2').value);
    var c=Number(document.getElementById('下拉框3').value);
    var d=Number(document.getElementById('下拉框4').value);
    var total=a+b+c+d;
    document.getElementById('txtTotalFee').value=total;
    }
    </script>            <asp:TextBox ID="txtTotalFee" runat="server" CssClass="InputCss" 
                    onfocus="gettotal()" ReadOnly="true"  Width="140px"></asp:TextBox>
      

  4.   

    那好吧,详细点,应该是没有添加drop1,drop2,...js报错的缘故<html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>    <script language="javascript">
        function gettotal()
        {
            var a=Number(document.getElementById('drop1').value);
            var b=Number(document.getElementById('drop2').value);
            var c=Number(document.getElementById('drop3').value);
            var d=Number(document.getElementById('drop4').value);
            var total=a+b+c+d;
            document.getElementById('txtTotalFee').value=total;
        }
        </script></head>
    <body>
        <form id="form1" runat="server">
            <div>
                <asp:DropDownList ID="drop1" runat="server">
                    <asp:ListItem>7</asp:ListItem>
                </asp:DropDownList>
                <asp:DropDownList ID="drop2" runat="server">
                    <asp:ListItem>5</asp:ListItem>
                </asp:DropDownList>
                <asp:DropDownList ID="drop3" runat="server">
                    <asp:ListItem>2</asp:ListItem>
                </asp:DropDownList>
                <asp:DropDownList ID="drop4" runat="server">
                    <asp:ListItem>9</asp:ListItem>
                </asp:DropDownList>
                <asp:TextBox ID="txtTotalFee" runat="server" CssClass="InputCss" onfocus="gettotal()"
                    ReadOnly="true" Width="140px"></asp:TextBox>
            </div>
        </form>
    </body>
    </html>
      

  5.   

    我用是aspx页面,好像取不到值???难搞!!
      

  6.   

    哈哈,页面加个UpdatePanel,然后对四个DropDownList添加SelectedIndexChanged事件,完事了
      

  7.   


    晕就是aspx页面,把上面部分复制,代替你新建的页面的这部分!
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        
        </div>
        </form>
    </body>
    </html>