that doesn't involve catching key presses ?
views:
37answers:
3but I don't want it to fire onclick. I want it to fire when val has changed, and focus is not lost
NimChimpsky
2010-10-07 15:00:45
+1
A:
Not really. Using the key press and checking manually if there is a change is the standard workaround for IE6.
Sohnee
2010-10-07 15:01:02
A:
Start an interval timer and poll the input?
var myInput = document.getElementById('myId');
var lastvalue = myInput.value;
var timerID = setInterval( function() {
if (myInput.value !== lastValue) {
// TODO call your "changed" method here
lastValue = myInput.value;
}
}, 100 );
What are you watching for that can happen that involves changing the input's value without keystrokes while it has focus? paste by mouse or menu? there might be events for those situations but I'm don't know any offhand.
edits: never mind all that. it looks like ie6 should support cut/copy/paste events on text inputs.
lincolnk
2010-10-07 15:01:35