View Full Version : OnChangeEvent of Textbox is not firing in IE but fires in Opera

01-21-2006, 08:01 AM
Onchange event of textbox is not firing in IE under this condition but fires in Opera.

After changing the value, in the tab key press again i'm changing the value dynamically at this time the onchange event is not firing. But it works fine in Opera. Have a look at the code.
<input type="text" name="1" id="1" onkeydown="one_onkd();" onchange="txt_onchange();"><input type="text" name="2" id="2" onchange="txt_onchange();">
function one_onkd()
if (event.keyCode==9)
function txt_onchange()
alert("On Change event of " + event.srcElement.id);

01-21-2006, 11:40 AM
onchange will not fire the function until the field loses it's focus (onblur), this is the reson for usually it is better to use unkeyup instead of onchange in case of text fields or textareas.