I have taken 2 frames..........
One is left.html and right.html
In right hand side frame I have taken text box and on an Enter press it call the function written in left hand side. ................
and adds the value in left hand side Div tag on Enter key press Event.................
The code is as follows
---------------------------------------------------------------------------------------------------------
main.html
<html>
<head>
</head>
<frameset cols="15%, *" id="fs1">
<frame src="left.html" name="left" frameborder="1" id=leftId>
<frame src="right.html" name="right" frameborder="1" id=leftId>
</frameset>
</html>
left.html
<html>
<head>
<link rel="stylesheet" href="test.css" type="text/css" />
<script>
function Entry(evt,txtID)
{
var charCode = (evt.which) ? evt.which : event.keyCode;
//At this statement IE does not recognize which event is fired and firefox recognize it
if(charCode==13) // if Enter key is pressed
{
var txtObj=parent.right.document.getElementById(txtID);
if(txtObj.value=="")
return;
divObj=document.getElementById("divID");
divObj.innerHTML=divObj.innerHTML+txtObj.value+"<br>";
txtObj.value="";
}
}
</script>
</head>
<body>
<div id="divID"></div>
</body>
</html>
right.html
<html>
<body>
<input type=text id="entryID" onkeypress="parent.left.Entry(event,this.id)";>
</body>
</html>
-------------------------------------------------------------------------------------------------------
It works well in mozilla but not in IE
so please tell me...........................
I need U R help.................................



Reply With Quote

Bookmarks