HTML frame, sharing data

Posted on 2004-11-11
Last Modified: 2006-11-17
Hi everybody,

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

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.
Question by:vinceTrace
    LVL 53

    Expert Comment

    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:


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


    Author Comment

    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">

    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...
    LVL 53

    Accepted Solution

    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()

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

    LVL 53

    Expert Comment

    Glad I could help. Thanks for the A. :^)


    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
    JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now