TextBox 框onkeydown(),该事件执行2个方法

来源:互联网 发布:软件设计师学校 编辑:程序博客网 时间:2024/06/05 05:28

 当触发onkeydown该事件时,隐藏其它控件,然后再验证输入,

 //The txtperiod clicks affairs
    function onkeydownFun()
    {
       if(document.getElementById("<%=divHrStep1.ClientID %>")!=undefined)//The hr div concealed, the object don't was early to start to turn
       {
           document.getElementById("<%=divHrStep1.ClientID %>").style.display='none';
       }
       var btnValidate=   document.getElementById("<%=btnValidate.ClientID %>");
       var divStep1= document.getElementById("<%=divStep1.ClientID %>");
       if(divStep1!=undefined)
            divStep1.style.display='none';
       if(btnValidate!=undefined)
           btnValidate.disabled=false;
    }
   
    function TwoEvent(e)
    {
        onkeydownFun();
        return LimitNumberInput(e);
   
    }

 

<asp:TextBox ID="txtPeriod" runat="server" Width="54px" TextFormat="SmallInt" onkeydown="return TwoEvent(this);"
                            MaxLength="6" Text=""></asp:TextBox>

原创粉丝点击