homepage Welcome to WebmasterWorld Guest from 54.225.18.187
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Jump Menu target iframe / Drop Down Menu and iFrame
Drop Down Menu and iFrame or jump menu target iframe
eli_geske




msg:3632270
 1:20 pm on Apr 22, 2008 (gmt 0)

I have been searching all over forums for a fix to target an iframe from a drop down menu with Javascript. Dreamweaver creates it some script for you but you can only target parent window with the version that I have. Below is working in firefox and Ie.

<html><head><title></title></head>
<script type="text/JavaScript">

function jumpMenu(targ,selObj,restore)
{
var url = selObj.options[selObj.selectedIndex].value;
selObj.options[selObj.selectedIndex].value +"'");
var iframe = document.getElementById('frame1');
iframe.src = url;

if (restore) selObj.selectedIndex=0;
}

</script>
</head>

<body>

<form name="form1" id="form1">
<select name="menu1" onChange="jumpMenu('parent',this,0)">
<option value="http://www.pinnaclepayment.com">URL 1</option>
<option value="http://www.google.com">URL 2</option>
</select>
</form>
<iframe id="frame1" src="" height="300" width="300"></iframe>
</body>
</html>

 

BlobFisk




msg:3632372
 3:06 pm on Apr 22, 2008 (gmt 0)

Hi eli_geske and welcome to WebmasterWorld!

You should be able to manipulate any iFrame using javascript:

document.getElementById('frame1').document.getElementById('myElem')...

HTH

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved