捕获客户端的文本改变事件的ASP:文本框 [英] Capture client side text change event for asp:TextBox

查看:223
本文介绍了捕获客户端的文本改变事件的ASP:文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含一个文本框的形式。一个弹出窗口将返回一个值,放入文本框。当这种情况发生,我需要填充另一个控制。我试图尝试的onChange,但它不会被触发。如何才能实现这一目标?

I have a form that contains a TextBox. A pop up window will return a value and put it into the TextBox. when this happens, I need to populate another control. I tried tried "onChange" but it was not triggered . How can this be achieved?

推荐答案

您可以使用 的onchange ,但是这通常不会丝的直到箱失去焦点的。还有 的onkeyup ,你希望,如果你想马上新的文本来使用。

You can use onchange, but this usually won't wire until the box loses focus. There's also onkeyup, which you want to use if you want the new text immediately.

您可以控制​​窗口填充文本框?如果是的话那是你的最佳路线,因为它是事件的源头,只是援引从那里第三对照人群,通过在父页面的功能。

Can you control the window populating the textbox? If so that's your best route, since it's the source of the event, just invoking the third control population from there, via a function in the parent page.

如果没有基于数字效果,可以绑定事件到 的onchange 的onclick 的onkeyup 来处理所有的情况下,它会运行一些额外的,但如果它是一个轻量级的操作,没有多跑副作用,你想掩盖你的基地,这是一个可行的选择。

If there are no number based effects, you can bind the event to onchange, onclick and onkeyup to handle all cases, it'll run a bit extra, but if it's a lightweight operation, no multi-run side-effects and you want to cover your bases, it's a viable option.

这篇关于捕获客户端的文本改变事件的ASP:文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆