how to detect change in input text field initiated by mouse?

J

jd

I want to be able to detect all changes to an html input text field. I
can catch keyboard events but I can't figure out what event gets
triggered if the text was inserted in some other way -- for example,
via a right click and paste or via autocomplete.

Thanks...

-- jeff
 
C

Csaba Gabor

jd said:
I want to be able to detect all changes to an html input text field. I
can catch keyboard events but I can't figure out what event gets
triggered if the text was inserted in some other way -- for example,
via a right click and paste or via autocomplete.

You might try:
onpropertychange for IE, and
oninput for FF

Csaba Gabor from Vienna
 
J

jd

Followup: the suggested solution works. However, there is a bug in
Firefox (1.0.7?) that prevents the myObj.oninput property from being
set directly. The workaround is to use addEventListener:

if( myObj.addEventListener )
myObj.addEventListener("input", myFunc, true);

(Bugzilla Bug# 195696)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top