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

How to control element on another Iframe from an Iframe (see description)

hi there,

if i have a page with two iFrames (1 and 2).  how can i control the elements in iFrame2 from iFrame1.  for example, if I like to hide a button on iFrame2 when a button in iFrame1 is clicked.

please provide syntax.

thanks in advance
0
Wayne88
Asked:
Wayne88
  • 4
  • 3
2 Solutions
 
jonahzonaCommented:
This looks like it might help you.

http://www.dyn-web.com/tutorials/iframes/refs.php

Syntax provided on page.
0
 
Wayne88Author Commented:
hi jonahzona, thanks for your help but i cannot seems to get the syntax right.  i had tried almost everything:

//document.getElementById('I2').setAttribute('src','www.google.ca');
//val = "document.all("www.google.ca").value;";
//document.all.I2.src=val;
//var myFrame = document.getElementById('I2');
//myFrame.src = "http://www.yahoo.com";
//window.frames.I2.location="http://www.yahoo.com";
//document.write("http://server/cgi-bin/calendar.pl?target=calendarContainer&...'><\/script>");

where I2 is the name of my second frame and i am trying to send a link from frame I1
0
 
jonahzonaCommented:
When I get home tonight, if this is still unanswered I'll help you out.

Going to a rehearsal dinner for my brothers wedding, so I will be unavailable for a few hours...
0
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!

 
Wayne88Author Commented:
thanks, no hurry. enjoy.
0
 
jonahzonaCommented:
Can you post the parsed html of what you were working on?
0
 
Wayne88Author Commented:
hi jonahzona,

the code is attached. i have the main page (iFrame) then inside the main page there are 2 frames that calls page1.htm and page2.htm

what i would like to do for example is hide the button on page2.htm when the user click on the button on page1.htm.
iframe.zip
0
 
Wayne88Author Commented:
Solved my problem by using regular frame instead of iFrame.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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