473,774 Members | 2,138 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

JavaScript & iFrames

1 New Member
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="showL inks();">
<option value=""> Choose one </option>
<option value="11">Golf </option>
<option value="12">Bask etball</option>
</select>
</form>

function showLinks()
{
var selectVal = document.forms['Form1'].elements['topic'].options;
if (selectVal.valu e == '11') {
document.getEle mentById('links 1').style.visib ility='hidden';
document.getEle mentById('links 2').style.visib ility='visible' ;
}
else {
document.getEle mentById('links 1').style.visib ility='visible' ;
document.getEle mentById('links 2').style.visib ility='hidden';
}
}

Can anyone help with this?

Thanks,
Muletuv
Jul 3 '07 #1
1 1364
kovik
1,044 Recognized Expert Top Contributor
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
1815
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. The application I'm talking about is displaying data from database in grids, roughly speaking from 3 tables, that have parent-child relationship between them, and when you click on a row in a parent grid the content in the child grid should...
2
1428
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
8984
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 at the appropriate point? Currently I am calling iframes instead of using SSI. You can see why I'd want to switch.
2
2788
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 assuming this is because when i press the button it reloads the page and the frames can't be referenced. here's a simple example: <HTML> <script language="C#" runat="server">
0
1263
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 haven't tried is mixing ASP.NET 1.1 & ASP.NET 2.0 pages in the same website/application but each page in different iframes. I don't think it's possible to to have both ASP.NET 1.1 & 2.0 pages in
2
1287
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 when the user clicks on a link in I1. Is this possible with javascript? Thanks
11
2219
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 HTML file. It never needs to be reloaded and JS variables can be updated there as the visible screens progress. But...if I want to be a good internet samaritan and not use frames, what's the best way to replace that function?
4
1224
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
5640
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 section on the page. I'm currently using iframes as a work around and have been trying to read up on Ajax as another way around it. Problem is, i think using iframes i'm losing important keywords that would usually be right on the page. i initially...
0
9621
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10267
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7463
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.