Capture client side text change event for asp:Text

2019-05-16 17:47发布

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?

1条回答
forever°为你锁心
2楼-- · 2019-05-16 18:10

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.

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.

查看更多
登录 后发表回答