Why does the onchange event of my textbox fire on blur, but does not fire by every typed character ?
I want to get the entire entered text in textbox by every type by keyboard!
But onchange event only is fired on blur!
Besides onkeyup - onkeypress - onkeydown events do not help because at first these events fire and then last entered character is applied to the textbox.
What event should I use or how can I do that?
you want keyup, keydown, or a combination of them. during the keydown handler, you can get the before-event value of the textbox. during the keyup handler, you can get the after-event value. if you’re getting an empty string you’re doing something wrong.
edit: here’s an example demonstrating how these 2 events works. typing in the first box updates the other two.
(works in firefox/chrome)