Click to See Complete Forum and Search --> : drop down menu help


phurwitz
02-08-2003, 09:21 PM
Hi All,
I have a drop down menu that I am using on my website.
My homepage has 2 frames. One frame has a drop down menu and the other displays content. The way it works is that when I choose an option in the dropdown, it loads another page in the menu frame and there are links there for loading content in the main frame. I would like to change it so that when you choose an option it just loads a page in the main frame, but I can't figure out how to get the dropdown to load into another frame.

Here is the code for my drop down:
<script language="javascript"><!--
function bam(form){
if (form.location.options[form.location.selectedIndex].value == "") return;
else window.location.href =
form.location.options[form.location.selectedIndex].value;
}
// --></script>
</HEAD>
<BODY BGCOLOR="#5DBACA">
<P><FORM ACTION="" METHOD=POST>
<P><SELECT NAME=location onchange="bam(this.form)" accesskey=C>
<OPTION SELECTED>Choose a topic:
<OPTION VALUE="resources_menu.htm">Internet Stuff
<OPTION VALUE="stores_menu.htm">Online Shopping
<OPTION VALUE="ems_menu.htm">Medical Info
<OPTION VALUE="comps_menu.htm">Computer Info
<OPTION VALUE="photo_menu.htm">Photography
<OPTION VALUE="trivial_pursuits_menu.htm">Trivial Pursuits
</SELECT>
</FORM></P>


Any suggestions are appreciated,
Paul

pyro
02-08-2003, 10:02 PM
Change this
else window.location.href = form.location.options[form.location.selectedIndex].value;

to this

else top.framename.location.href = form.location.options[form.location.selectedIndex].value;

where framename is the name of your main frame.

phurwitz
02-10-2003, 07:58 AM
Thanks Pyro.
This is exactly what I am looking for. Its works perfectly.

Thanks!