开发者

Problem handling onchange on a textbox

I have a GridView with textboxes in its cells. I need to call a javascript function when the user changes the contents of a TextBox, and then hits Enter or leaves the TextBox. The latter is achieved by doing oncha开发者_如何学运维nge="MyJavascriptFunc", but the javascript function is not called when Enter is pressed. If I call the javascript function from EnterKeyPressHandler function, MyJavascriptFunc is called twice, which I would prefer to avoid. Could you please help me with this? Thanks.


Check if the func is called when the user presses enter.

  var called = false;
  if(called != true) 
  {
       called = true;
       // and do sth
  }
  called = false;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜