PDA

View Full Version : An HTML Question Using Frames


baloney_mahoney
06-10-2004, 03:02 PM
Main HTML document.........

<html>
<head><title>MAIN HTML DOCUMENT</title></head>

<frameset ........................>
<frame name="topframe" src="topframe.html" >
<frame name="bottomframe" src="bottomframe.html">
</frameset>

<script language="javascript">

function myFunction()
**
//
// do something here
//
}
</script>

</html>

Here is what I want to do. In the HTML document 'bottomframe.html" there is a submit button that when I
click on it I want it to call a Java Script function that is in the other HTML document 'topframe.html'.

Is this possible and if yes how is it done?

Also, is it possible for either HTML documents, 'topframe.html' and/or 'bottomframe.html', to call the
Java Script function 'myFunction' in the main HTML document?

Realged13
06-10-2004, 07:27 PM
I've never really tried to do this before but the way you explained it, you should be able to.

nscopex
06-14-2004, 02:05 PM
Use an Iframe and have the Java point to the top frame when you want it to go the top frame

baloney_mahoney
06-14-2004, 04:20 PM
OK, thanks for you help and that is exactly what I did by having a Java function in the 'bottomframe.html' do something similar to the below:

<html>
<!-- This is the bottomframe.html -->
<form name="bottom" target="topframe" action="topframe.html">
<input type="submit" onClick="CallTopFrame()">
</form>
<script language="javascript">
function CallTopFrame()
**
'
' do other stuff here
'
document.bottom.submit();
}
</script>
</html>

<html>
<!-- This is the topframe.html -->
<body onLoad="TopFrameFunction()">
<form name="top" action=".....">
'
</form>
<script language="javascript">
function TopFrameFunction()
**
'
'
}
</script>
</html>