OnTextChanged事件触发第二个输入值 [英] OnTextChanged event Firing For Second input value
本文介绍了OnTextChanged事件触发第二个输入值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<asp:TextBox ID="txt1" runat="server" CssClass="Text" AutoPostBack="true" MaxLength="10" OnTextChanged="txt1_OnTextChanged" onblur="Change(this, event)" onfocus="Change(this, event)">
</asp:TextBox>
这是我的文本框代码,当我从前一个文本框移动焦点到这一个(txt1)并输入一些值然后它不工作(不要激活事件)但是如果我点击任何地方的表格然后我输入值然后它将工作正常。
This is my Textbox code when i move focus from previous Textbox To this one (txt1) and input some value then it don''t work(don''t fire event) BUT if i click on form anywhere and then i input value then it will work fine.
protected void txt1_OnTextChanged(object sender, EventArgs e)
{
Some line of code
------------
------------
}
以上代码在aspx.cs文件中
Plz帮助我这个
谢谢。
This above code in aspx.cs file
Plz help me on this
thanks.
推荐答案
使用jquery.You可以在一个控件上绑定多个事件。请确保你必须把jquery插入来实现jQuery.You可以从这里获得jQuery插件 http://jquery.com/ [ ^ ]
Use jquery.You can bind multiple events on one control.Please make sure that you must put jquery pluging for implementing jQuery.You can get jQuery plugin from here http://jquery.com/[^]
( document )。ready( function ()
{
(document).ready(function() {
(' #txt1')。bind(' blur focus', function (){
alert( 工作);
});
});
('#txt1').bind('blur focus', function() { alert("Worked"); }); });
希望这有帮助
Hope this helps
这篇关于OnTextChanged事件触发第二个输入值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文