• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • Last Modified:

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
0
vinceTrace
Asked:
vinceTrace
  • 3
1 Solution
 
COBOLdinosaurCommented:
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&
0
 
vinceTraceAuthor Commented:
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
0
 
COBOLdinosaurCommented:
okay give the frame with the alert a name so it can be reference and make the alert a function:

<script type="text/javascript">
function doalert()
{
alert(top.frames['helpActions'].document.frmMemo.txtSearch.value);
}
</script>

then on the button call the function like this:
<input type="button" onclick="top.frames['nameofframe'].doalert()">

Cd&
0
 
COBOLdinosaurCommented:
Glad I could help. Thanks for the A. :^)

Cd&
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now