473,387 Members | 1,585 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

JavaScript & iFrames

Hi,

I am creating a form that displays a different list of links depending on a value that is selected within the form. These links are contained in an iFrame and each set of links is in a div.

I have written the javascript to display the relevant links but don't know how to reference the iFrame in the main page or vice versa.

<form name="Form1">
<select name="topic" onChange="showLinks();">
<option value=""> Choose one </option>
<option value="11">Golf </option>
<option value="12">Basketball</option>
</select>
</form>

function showLinks()
{
var selectVal = document.forms['Form1'].elements['topic'].options;
if (selectVal.value == '11') {
document.getElementById('links1').style.visibility ='hidden';
document.getElementById('links2').style.visibility ='visible';
}
else {
document.getElementById('links1').style.visibility ='visible';
document.getElementById('links2').style.visibility ='hidden';
}
}

Can anyone help with this?

Thanks,
Muletuv
Jul 3 '07 #1
1 1347
kovik
1,044 Expert 1GB
Why use an iframe? If it's on a separate page, it wouldn't count as a part of the form. You could always retrieve the content of the outside page with AJAX.
Jul 3 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Halldor Isak Gylfason | last post by:
I am faced with the task of porting a client application to a web architecture platform, e.g. to make it browser based. The technology I used was J2EE, e.g. servlets/JSP pages and HTML/javascript....
2
by: Carl | last post by:
I want to load a javascript file on a root page with various iframes, then call the javascript functions from the root page to be displayed in the iframes. Any idea how to do this?
6
by: Jane Withnolastname | last post by:
How can I include a file using JavaScript? document.write('<!--#include file="myfile.htm" -->') won't work because of the commenting. Is there a way to fool JavaScript into including the file...
2
by: dh | last post by:
How can a button that resides on the Main page tell the child Iframes to redirect without the page posting back? I keep getting a javascript error: "frames.iframe1 is null or not an object." I'm...
0
by: dhruba.bandopadhyay | last post by:
I know that it's possible to mix ASP & ASP.NET 1.1 in the same website/application so long as they are in separate frames (iframes). This also holds for mixing ASP & ASP.NET 2.0 pages. But what I...
2
by: Joris De Groote | last post by:
Hi, I am looking for a javascript that can open a link in an iframe. However, the link on wich the user clicks, is from another iframe. So I have 2 Iframes and want to get a html page open in I2...
11
by: Kent Feiler | last post by:
One thing I like about frames is that they're a good place to stow Javascript. Javascript that I'd like to be around while the visible content of the screen changes goes in the frame declaration...
4
by: Moptop650 | last post by:
Is it possible to, with javascript, scroll an iframe that you do not have control of the content of? If so, how? If not, is there any other method to?
21
by: wizdom | last post by:
I've tried a few things but nothing seems to work, i'm starting to think this isnt possible. I basically am looking to have the user click on the video number, then have the video load in its own...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.