JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 20th, 2007, 03:18 PM
dledet1 dledet1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Location: Washington, DC
Posts: 8 dledet1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 41 m 54 sec
Reputation Power: 0
Using a form jump menu to target iFrame on a different page

Any help is greatly appreciated! I am creating a drop down menu on my index page that will jump to a specific iframe on an inside page.

The only help I seem to find concerns form menus that are targeting iframes within the same page. Here is the code I have so far:

<form name="jump" target="iframetest">
<select name="menu" onchange="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;">
<option selected="selected">Select a Tool</option>
<option value="about.htm">About CYM</option>
<option value="using.htm">Using the Toolkit</option>
<option value="acknow.htm">Acknowledgements</option>
<option value="toc.htm">Table of Contents</option>
</select>
</form>

I should have some javascript code that would go in the head tags, but I wasn't given any, so I would need some help with that as well.

Also, "iframetest" is what I named my iframe on the inside page.

Again, any help is appreciated! Thank you in advance!


Deanna

Reply With Quote
  #2  
Old March 20th, 2007, 04:12 PM
magicxxxx magicxxxx is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: UK, London
Posts: 94 magicxxxx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 44 m 38 sec
Reputation Power: 9
Example

Hi, I would do this like that, hope it is what U need:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="javascript1.2" type="text/javascript">
function  changeLocation(locationUrl)
{
 document.getElementById('iframetest').src=locationUrl

}
</script>
</head>

<body>
<form name="jump" target="iframetest">
<select name="menu" onchange="changeLocation(this.options[this.selectedIndex].value);">
<option selected="selected">Select a Tool</option>
<option value="about.htm">About CYM</option>
<option value="using.htm">Using the Toolkit</option>
<option value="acknow.htm">Acknowledgements</option>
<option value="toc.htm">Table of Contents</option>
</select>
</form>
<iframe id="iframetest" name="iframetest" src=""></iframe>
</body>
</html>


regards,
Piotr

Reply With Quote
  #3  
Old March 20th, 2007, 04:41 PM
dledet1 dledet1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Location: Washington, DC
Posts: 8 dledet1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 41 m 54 sec
Reputation Power: 0
Thanks for the reply! I was actually hoping to figure out how to target an iframe on a different page from the drop down form menu. I think this code targets it from within the same page.

Any other ideas? Thanks again!

Reply With Quote
  #4  
Old March 20th, 2007, 05:06 PM
magicxxxx magicxxxx is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: UK, London
Posts: 94 magicxxxx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 44 m 38 sec
Reputation Power: 9
Maybe like this

It depends what is that different page? A popup window, or just other page in the same window.

1. Popup:

The small changes in my provious function

Code:
function  changeLocation(locationUrl)
{
 	var params ='width='+ 300 +',height='+ 300 +',resizable=yes,scrollbars=yes,menubar=no,statusbar=yes'
	var Win = window.open('test3.html','test',params);
	Win.document.getElementById('iframetest').src=locationUrl
}


First poping up new window and then passing the value to iframe in that window

2. If another page is supposed to be open after choosing something from the dropdown U just need to send that value by get or post to that page and from there pass it to src of the iframe.

hope now it will help

Regards,
Piotr

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Using a form jump menu to target iFrame on a different page

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap