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>
//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>
相关文章推荐
- bootstrap 事件shown.bs.modal用于监听并执行你自己的代码【写hostmanger关联部门遇到的问题及解决方法】
- JS实现判断滚动条滚到页面底部并执行事件的方法
- textbox控件输入内容后按下Enter键后执行button1的click方法
- 在IE浏览器中resize事件执行多次的解决方法
- Jquery双击事件不触发执行单击事件解决方法
- Jquery双击事件不触发执行单击事件解决方法
- Jquery双击事件不触发执行单击事件解决方法
- onClick事件中含有异步执行的方法,如何让异步方法执行完毕后onClick事件方可重新响应点击事件
- 解决C#中WebBrowser的DocumentCompleted事件不执行的实现方法
- WPF TreeView 选择事件执行两次,获取TreeView的父节点的解决方法
- onload事件不执行的解决方法
- Jquery on方法绑定事件后执行多次的解决方法
- ToolStrip失去焦点时,点击第二次才执行事件的解决方法
- jQuery hover事件简单实现同时绑定2个方法
- 获得执行计划方法四-使用10046事件
- 在TextBox中敲击回车执行ASP.NET后台事件
- Js先触发失去焦点事件再执行点击事件解决方法
- 使用反射令2个事件在不知道方法名的情况下使用同一个处理方法
- 获得执行计划方法四-使用10046事件
- WebBrowser 的 DocumentCompleted事件不执行的解决方法