Capture client side text change event for asp:TextBox

浪尽此生 提交于 2019-12-07 13:47:44

问题


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:


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.



来源:https://stackoverflow.com/questions/3075292/capture-client-side-text-change-event-for-asptextbox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!