改变TextBox的可读性

 <script language="javascript">
    function ChangeTimeEnable(ddl)
    {
        if ("是" == ddl.value)
        {
            document.getElementById('<%=txtRequireTime.ClientID %>').disabled = false;
            document.getElementById('<%=txtRealityTime.ClientID %>').disabled = false;
        }
        else
        {
            document.getElementById('<%=txtRequireTime.ClientID %>').disabled = true;
            document.getElementById('<%=txtRealityTime.ClientID %>').disabled = true;
        }
    }
    </script>

===================

<asp:DropDownList ID="ddlChange" runat="server" onChange="ChangeTimeEnable(this)">
    </asp:DropDownList>

<asp:TextBox ID="txtRequireTime" runat="server" ></asp:TextBox>

posted on 2010-06-17 10:55  xrt2004  阅读(147)  评论(0编辑  收藏  举报

导航