Client-side text change event capture for asp: TextBox

I have a form containing a TextBox. A popup will return a value and place it in a TextBox. When this happens, I need to populate another control. I tried to try "onChange", but it was not running. How can this be achieved?

+3
source share
1 answer

You can use onchange, but usually it will not be projected until the field loses focus. There is also onkeyupwhich you want to use if you want immediate new text.

Can you control the window filling the text box? If so, your best route, since it is the source of the event, just calls the third control group from there using the function on the parent page.

If there are no numerical effects, you can bind the event to onchange, onclickand onkeyupto handle all cases, it will work a little longer, but if it is an easy operation, without reusable side effects, and you want to cover your bases, this is a viable option.

+6
source

Source: https://habr.com/ru/post/1750800/


All Articles