Posted by: San August 23, 2008
Frames in Frameset - HTML
Login in to Rate this Post:     0       ?        
Have seen this thread for a few days. Here's one way to do it.
When you have to access multiple elements it's always good to call the DOM properties. When you type in one textbox the otherone will update at the same time. You can use different methods of doing this such as by creating another button and assigning the onclick event instead of the onkeyup event. I'm sure there are many other ways to do it.

File no. 1: index.htm
<frameset cols="250,*" border="2">
<frame src="left.htm" name="leftframe" style="background-color:#ccc;">
<frame src="right.htm" name="rightframe"  style="background-color:green;">
</frameset>


File no 2: left.htm:
<input type="text" name="leftentry" id="leftentry" onkeyup="top.frames[1].document.getElementById('rightentry').value=top.frames[0].document.getElementById('leftentry').value;">


File no 3: right.htm:

<input type="text" name="rightentry" id="rightentry" 
onkeyup="top.frames[0].document.getElementById('leftentry').value=top.frames[1].document.getElementById('rightentry').value;">
Read Full Discussion Thread for this article