In jQuery how can I track onchange
event if the value of textbox is changing dynamically from some other event. I tried this but its not working:
keyup
doesn't cover all natural cases :(
Two cases when change
and keyup
won't work:
Example: form has textbox intended to put an email address into it, and onchange, keyup events are attached to it.
When user starts typing an email address, if e.g. Chrome or Firefox autocomplete box pops up and user clicks one of the options, the box gets filled with the value, focus stays within the textbox (so no change event firing) and no key was pressed (no keyup event). I tried attaching click to the list, but it causes weird behavior in my browser.
Similar with pasting - if mouse is used for pasting (through contextual menu available on right mouse click)), neither keyup nor change events are fired.
Anyone has a complete solution for this, i.e. how to handle actual changes of the value of the input?