Link to home
Start Free TrialLog in
Avatar of Wayne88
Wayne88Flag for Canada

asked on

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
Avatar of jonahzona
jonahzona
Flag of United States of America image

This looks like it might help you.

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

Syntax provided on page.
Avatar of Wayne88

ASKER

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
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...
Avatar of Wayne88

ASKER

thanks, no hurry. enjoy.
SOLUTION
Avatar of jonahzona
jonahzona
Flag of United States of America 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
ASKER CERTIFIED SOLUTION
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
Avatar of Wayne88

ASKER

Solved my problem by using regular frame instead of iFrame.