Link to home
Start Free TrialLog in
Avatar of vinceTrace
vinceTrace

asked on

HTML frame, sharing data

Hi everybody,

I've made an HTML page with several frames :
<HTML>
<HEAD>
<TITLE>My software Help</TITLE>
</HEAD>
<FRAMESET cols="20%,80%">
   <FRAMESET rows="10%,25%,65%">
      <FRAME src="HelpMenu.php">
      <FRAME src="HelpActions.php">
      <FRAME src="HelpListRubrique.php">
   </FRAMESET>
   <FRAMESET rows="15%,85%">
      <FRAME src="RubriqueTitle.php" frameborder="NO">
      <FRAME src="RubriqueContent.php" frameborder="NO">
   </FRAMESET>
</FRAMESET>
</HTML>      

It works, but now I'd like to know how I could send data from a frame to another one...
For example diplaying in a frame the text written by the user (<input type="text"..>) in another frame.
Hope I've been clear..
Thanky by advance.
Vincent
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

To start with you need to give the frames a name property so they are easily referenced:

<frame src="HelpMenu.php" name="helpM">

that way in any of the other frames you can reference the page in the frame with scripting this way:

top.frames['helpM'].document

How skilled are you at JavaScript?  You will have to provide a lot more detail if you need help with the actual coding.

Cd&
Avatar of vinceTrace
vinceTrace

ASKER

Thanks for your answer.
I've give a name property to one of my frame ('helpActions'), and in another frame I've written:

<script language="javascript">
alert(top.frames['helpActions'].document.frmMemo.txtSearch.value);
</script>

And when the page is loaded, the alert message appears and displays the right thing (I've initialized the text input 'txtSearch' in the first frame).
But now I'd like that when I update this text input and click on the button "Search" (in the same frame than 'txtSearch') it updates the second frame (the alert message should display the content of the text input...)

It could maybe help if I mention that I'm trying to do a HTML help for a software I'm developping...
Thanks!
Vincent
ASKER CERTIFIED SOLUTION
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Glad I could help. Thanks for the A. :^)

Cd&