Link to home
Start Free TrialLog in
Avatar of pinkstonm
pinkstonm

asked on

Page with iframe ?

I have a page with an iframe in it and the outer part of the page has a button that I want to when clicked modify the contents of the iframe.

The iframe statement I have is
    <!-- <p class="headlines" style="margin-bottom: 2px">  -->
      <iframe src="inc_sitelist.asp" width="100%" height="100%" frameborder="1" name="news" style="padding-right: 0px" marginheight="5" marginwidth="5">      </iframe>
    <!-- </p> -->    

The the button is clicked I would like the contents to change to inc_adminlist.asp.  

Any thoughts?

Thanks
Avatar of third
third
Flag of Philippines image

try this just change the page sources

<iframe src="http://www.google.com" width="100%" height="100%" frameborder="1" id="newsid" name="news" style="padding-right: 0px" marginheight="5" marginwidth="5">      </iframe>
<input type="button" name="btn" value="Click" onclick="document.getElementById('newsid').src='http://www.yahoo.com';">
Avatar of pinkstonm
pinkstonm

ASKER

<a href=_blank class="grey" onclick="document.getElementById('newsid').src='inc_adminlist.asp';" onmouseover="return overlib('Site List Master administrative functions including security', BGCOLOR, '878787', FGCOLOR, 'E6E6E6', CAPCOLOR, 'FFFFFF', CAPTION,  'administrative functions');" onmouseout="return nd();">admin</a>

I tried to put in a _blank but that does not work if I remove the href it works but distorts the look of the value becuase of css values.

Anythoughts
ASKER CERTIFIED SOLUTION
Avatar of third
third
Flag of Philippines 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
If the button is in the main part of the page and you want to change the iframe contents, all you need is to add a target to a regular link. iFrames work just like regular frames.
Thanks works nice