您的位置:首页 > 其它

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

2009-11-20 17:10 106 查看
当触发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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: