[RESOLVED] watch() on an input element's value?
Okay, I need to know when something is pasted or deleted in a text field by way of the context menu. So I figured I'd use the watch() method on the text field for the value property. But the text field doesn't support the watch method.
Does anybody know of a way to accomplish what I want?
:afrog:
Re: watch() on an input element's value?
Try onChange. watch() is meant for variables rather than element properties/values.
:afrog: :afrog:
Re: watch() on an input element's value?
Unfortunately onChange won't work in my case. onChange only seems to fire when the field loses focus, and I need to know that the change is occuring as it is occuring, not after the fact.
:afrog: :afrog: :afrog:
Re: watch() on an input element's value?
That's about as far as you can get with javascript. Reminds you of women doesn't it?
Do you have control over the context menu's javascript? If so, you can populate the textbox and then call your function.
Alternately, have a timer function which constantly polls the textbox, grabs the value and compares it with the next value.
Re: watch() on an input element's value?
Re: watch() on an input element's value?
onkeyup, and onmousedown combined, should cover it.
Re: watch() on an input element's value?
Actually I just found out about the onPropertyChange event which seems to work. Its IE specific I think, but this is for an intranet app, so the client is guarunteed to be IE.