Iframe src to change the src of another Iframe

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Oct 2009
Posts: 2
Reputation: 3000MAN is an unknown quantity at this point 
Solved Threads: 0
3000MAN 3000MAN is offline Offline
Newbie Poster

Iframe src to change the src of another Iframe

 
0
  #1
Oct 25th, 2009
Getting to the poiint; I have a 'index.html' document that creates 3 iframes, each within a row of a 1 column, 3 row table. So I have a top (frame1), middle,(frame2) and bottom(frame3).

Frame1 src="header.html" is a descriptive banner.

Frame2 src="Start.html" is where the real application does all the work.

Frame3 src="footer.html" is a footer, that may contain 1 or more images or small buttons.

I will include the code for index.html at the end:

What I can't seem to do is have "start.html" change the content or src of frame1, recall start.html is the src of frame2. When a button within a form within start.html is pressed (onclick), a cgi (c program) outputs new html into frame2, a mainmenu of buttons. Now frame2 contains a list of buttons, and I want frame1 to contain text "Main Menu". Likewise, in the mainmenu, when the settings button is pressed a cgi program will output the settings HTML to frame2, and I want frame1 to contain the text "Settings".

Sure, the cgi program could change/re-write the contents of "header.html", but whats the best method, and then, how to reload the iframe, or change it's src.

frame2 needs to modify frame1 and later frame3.

Thanks in advance,

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <html>
  2. <head>
  3. <title>test run</title>
  4. <link rel="stylesheet" type="text/css" href="stdtheme.css" />
  5. </head>
  6. <center>
  7. <body>
  8. <br>
  9.  
  10. <table border="0" class="maintable" cellpadding="0" cellspacing="0">
  11. <tr>
  12. <td align="top">
  13. <iframe id="frame1" name="frame1" class="result_output" width="115%" height="27px" frameborder="0" scrolling="no" name="head"
  14. src="header.html"></iframe>
  15. </td>
  16. </tr>
  17. <tr>
  18. <td valign="center">
  19. <iframe id="frame2" class="result_output" width="115%" height="630px" frameborder="0" scrolling="yes" name="view"
  20. src="startup.html"></iframe>
  21. </td>
  22. </tr>
  23. <tr>
  24. <td align="bottom">
  25. <iframe id="frame3" class="result_output" width="115%" height="27px" frameborder="0" scrolling="no" name="foot"
  26. src="footer.html"></iframe>
  27. </td>
  28. </tr>
  29. <tr>
  30. <td align="left" class="bottomtext">
  31. bottom line text
  32. </td>
  33. </tr>
  34. </table>
  35. </center>
  36. </body>
  37. </html>
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 2
Reputation: 3000MAN is an unknown quantity at this point 
Solved Threads: 0
3000MAN 3000MAN is offline Offline
Newbie Poster
 
0
  #2
Oct 25th, 2009
Can anyone recommend another method?
Reply With Quote Quick reply to this message  
Reply

Tags
html, iframe, javascript

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC