Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Page with iframe ?

Posted on 2003-02-26
5
Medium Priority
?
235 Views
Last Modified: 2011-04-14
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
0
Comment
Question by:pinkstonm
  • 2
  • 2
5 Comments
 
LVL 30

Expert Comment

by:third
ID: 8029958
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';">
0
 

Author Comment

by:pinkstonm
ID: 8030347
<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
0
 
LVL 30

Accepted Solution

by:
third earned 200 total points
ID: 8030996
should be,

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

0
 
LVL 19

Expert Comment

by:webwoman
ID: 8034094
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.
0
 

Author Comment

by:pinkstonm
ID: 8034165
Thanks works nice
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

581 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