JavaScript Forum JS Made Easy: Free JavaScripts Tutorials Example Code
About This Product
The Business Internet
Find it on This page:
| Over 5000 Free Fonts | Tutorials | Javascript Forum | Other Javascript Resources | Cheat Sheet

Jsmadeeasy Forums Home   Search   Login   Register   Member List  
JS Made Easy  > JavaScript programming  > Using Frames with combo boxes?  
Display using:  
Previous Thread :: Next Thread 
 Author Thread: Using Frames with combo boxes?
BoomerDan is not online. Last active: 7/28/2004 3:52:08 PM BoomerDan
Top 100 Poster
Joined: 28 Jul 2004
Total Posts: 3
Using Frames with combo boxes?
Posted: 02 Jul 2002 09:01 AM
Hello, I am developing a two frame site (each named "top" and "bottom"). In the top frame, called "top", I have 4 comboboxes with a few selection that drop down. I'm using the bottom frame, called "bottom", to display an html page based on the users selection in the top frame. I'm using a JavaScript to try and do this. My page worked without frames, but apparently I'm missing something to move this into the framed site.

Below is the code I'm using as the top frame.



<script language="Javascript">

function goToURL(form) {

var index = form.dropdownmenu.selectedIndex
if (!index == "")



<body topmargin=0 leftmargin=0 bgcolor=darkblue>

<table border=0 cellspacing=0 cellpadding=0 width=100%>


<td valign=top width=10% align=middle>

<h3><font color=white size=2 face=Arial,Times,Courier>EMF</font></h3>


<td width=90% align=middle>

<form name="menuform">
<select name="dropdownmenu" onChange="goToURL(this.form)">
<option value="">OS Reports Available
<option value="total_mem_usage.html">Total Memory Usage
<option value="total.cpu.util.html">Total CPU Utilization

<select name="dropdownmenu" onChange="goToURL(this.form)">
<option value="" selected>DB Reports Available
<option value="listener_status.html">Listener Status
<option value="instance_status.html">Instance Status

<select name="dropdownmenu" onChange="goToURL(this.form)">
<option value="" selected>Application Reports Available
<option value="total_mem_usage.html">"Total e*Gate Application Memory Usage
<option value="total_cpu_util.html">Total e*Gate Application CPU Utilization

<select name="dropdownmenu" onChange="goToURL(this.form)">
<option value="" selected>Transaction Reports Available
<option value="867_810_814_flow.html">867_810_814 Flow
<option value="814_01_16.html">814_01 and 814_16 Flow
<option value="867_03_cis+.html">867_03 to CIS+ Report







The bottom frame starts out with basically nothing in it since it's going to be replaced with the page the user selects.

Can anyone figure out why the url of the selection isn't passed to the bottom frame's href property?

Thanks, Dan

qsaaiman is not online. Last active: 5/30/2006 4:23:08 AM qsaaiman
Top 25 Poster
Joined: 28 Jul 2004
Total Posts: 21
Posted: 03 Jul 2002 01:27 AM

This should solve your problem:

<script language="Javascript">
function goToURL(form) {
var sel_box_name =
var selectedItem = form[sel_box_name].selectedIndex
if (!selectedItem == "")
window.parent.bottom.location = form[sel_box_name].options[selectedItem].value

There was one error. You left out the last "}". :)
Just replace your script with the one above. Just rename your select boxes. Each must have a unique name. Well that's all really. :)


Quintin Saaiman
Department of Labour
IT Systems

Quintin Saaiman
Previous Thread :: Next Thread 
Page 1 of 1  > JS Made Easy  > JavaScript programming  > Using Frames with combo boxes?