View Full Version : onkeyup handler for IE

07-28-2011, 06:18 PM

I have the following code. This code is working fine in FF but not in IE.

Can any one let me know how i can resolve this.

function handlerFunc (elem, elem1) //elem1 is id of input tag
elem.onKeyUp = keyupHandler (elem1); //throwing error in IE. If i remove argument it is working fine, but i want to make it work with arguments.


function keyUpHandler (elem1)
alert (elem1.form.name);

Philip M
07-28-2011, 06:37 PM
For IE it is necessary to have at least two fields - one can be hidden/dummy:-

<div style="display:none">
<input type="text" name="hiddenTextField">

All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

07-28-2011, 07:34 PM
I didnot get your reply. Could you please explain in detail.

07-28-2011, 08:32 PM
I really cant tell from the code
what you want ?

maybe this ?

<form name="nm">
<input id="i1" >
<input id="i2" name="i2">

function handlerFunc (elem, elem1)
elem.onkeyup = function ()
alert (elem1.name);
} ;

var i1 = document.getElementById("i1");
var i2 = document.getElementById("i2");

handlerFunc (i1, i2) ;