Solved

2 dropdowns on same frame wont work

Posted on 2000-04-27
2
150 Views
Last Modified: 2010-04-09
I am trying to install 2 dropdown menus into a header frame so that when you choose the option the main frame below will change. This works as long as I only have one of the dropdowns on the frame. once I put the 2nd one in only one of them will work. You can click and the other and nothing happens. If I then remove the last one installed the original one will work again. I have pasted the html. Does anyone recognize my error. I assume something is named the same or something though I believe I have different names for the forms. This is being done in frontpage and I am cut and pasting the code from a site called "Sitecrafters". As you can probably tell this is my first
Possibly am I missing some html to separate the forms?

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<base target="main">
<meta name="Microsoft Border" content="none">
</head>

<body>

<div align="center">
  <center>
  <table border="1" width="100%" height="44">
    <tr>
     
     
      <td width="1%" height="24" valign="top"><form name="navform">
<p><select name="section" size="1" width="200" language="javascript" onchange="goto_page();">
   <option selected value="Navigate Site...">Navigate Site...</option>
   <option> - - - - - - - - - - - - - - - - - </option>
   <option>2 Staff Page</option>
   <option>3 Rex Home Page</option>
   <option>4 Services</option>
   <option>5 Dive Travel</option>
   <option>6 Site Index</option>
   <option>7 Dive Charters</option>
         <option>8 Local Tides</option>
      <option>9 Dive Links</option>
      <option>10 Rex Marina</option>

</select><script language="JavaScript"><!--
function goto_page() {
   if (document.navform.elements[0].selectedIndex == 0)
      window.parent.self.status=" Goes Nowhere";
else if (document.navform.elements[0].selectedIndex == 1)
      window.parent.self.status=" Goes Nowhere";
else if (document.navform.elements[0].selectedIndex == 2)
     window.open("http://www.rexdivecenter.com/staff.htm", target="main");
else if (document.navform.elements[0].selectedIndex == 3)
      window.open("http://www.rexdivecenter.com", target="main");
else if (document.navform.elements[0].selectedIndex == 4)
      window.open("http://www.rexdivecenter.com/services.htm", target="main");
else if (document.navform.elements[0].selectedIndex == 5)
      window.open("http://www.rexdivecenter.com/travel.htm", target="main");
else if (document.navform.elements[0].selectedIndex == 6)
      window.open("http://www.rexdivecenter.com/table_of_contents.htm", target="main");
else if (document.navform.elements[0].selectedIndex == 7)
      window.open("http://www.rexdivecenter.com/charters.htm", target="main");
else if (document.navform.elements[0].selectedIndex == 8)
      window.open("http://www.rexdivecenter.com/todays_tides.htm", target="main");
else if (document.navform.elements[0].selectedIndex == 9)
      window.open("http://www.rexdivecenter.com/divelinks.htm", target="main");
else if (document.navform.elements[0].selectedIndex == 10)
      window.open("http://www.rexdivecenter.com/marina.htm", target="main");
}
// --></script> </p>
</form></td>


      <td width="33%" height="24" valign="top"><form name="gearform">
<p><select name="section" size="1" width="200" language="javascript" onchange="goto_page();">
   <option selected value="Dive Gear...">Dive Gear...</option>
   <option> - - - - - - - - - - - - - - - - - </option>
   <option>2 Wetsuits</option>
   <option>3 Drysuits</option>
   <option>4 Accessories</option>
   <option>5 BC's</option>
   <option>6 Cameras</option>
   <option>7 Dive Computers</option>
   <option>8 Dive Lights</option>
   <option>9 Fins</option>
   <option>10 Guages/Consoles</option>
   <option>11 Regulators</option>
   <option>12 Masks/Snorkels</option>
   <option>13 Inflatables</option>
 
</select><script language="JavaScript"><!--
function goto_page() {
   if (document.gearform.elements[0].selectedIndex == 0)
      window.parent.self.status=" Goes Nowhere";
   else if (document.gearform.elements[0].selectedIndex == 1)
      window.parent.self.status=" Goes Nowhere";
 
else if (document.gearform.elements[0].selectedIndex == 2)
      window.open("http://www.rexdivecenter.com/equipment/wetsuits/wetsuits_info.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 3)
      window.open("http://www.rexdivecenter.com/equipment/drysuits/drysuit_info.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 4)
      window.open("http://www.rexdivecenter.com/construction.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 5)
      window.open("http://www.rexdivecenter.com/equipment/bc_s/bc_info.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 6)
     window.open("http://www.rexdivecenter.com/equipment/cameras/aquashot3.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 7)
      window.open("http://www.rexdivecenter.com/equipment/dive_computers/dive_computer_info.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 8)
      window.open("http://www.rexdivecenter.com/equipment/dive_lights/dive_lights.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 9)
      window.open("http://www.rexdivecenter.com/equipment/fins/fins_info.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 10)
      window.open("http://www.rexdivecenter.com/equipment/gauges_consoles/gauges_consoles_info.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 11)
      window.open("http://www.rexdivecenter.com/equipment/regulators/regulator_info.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 12)
      window.open("http://www.rexdivecenter.com/equipment/masks_snorkels/masks_info.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 13)
      window.open("http://www.rexdivecenter.com/equipment/inflatables.htm", target="main");
     
}
// --></script> </p></td>
      <td width="35%" height="24" valign="top">Cell 3</td>
     
     
     
      <td width="16%" height="24" valign="top">Cell4</td>
    </tr>
  </table>
  </center>
</div>

</body>

</html>
0
Comment
Question by:DavidNPD
2 Comments
 

Accepted Solution

by:
drapoc earned 100 total points
ID: 2756714
I pasted in the changed code, when I run this in IE5 it now goes to different pages and both pages are working. You were declaring the goto_page function twice I changed the first function to goto_page1 and the second to goto_page2 and then changed the event handler to point to the correct function. When you choose something now it spawns a new window, and displays the content, it did not load a new frame though.


<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<base target="main">
<meta name="Microsoft Border" content="none">
</head>

<body>

<div align="center">
  <center>
  <table border="1" width="100%" height="44">
    <tr>


      <td width="1%" height="24" valign="top"><form name="navform">
<p><select name="section" size="1" width="200" language="javascript" onchange="goto_page1();">
   <option selected value="Navigate Site...">Navigate Site...</option>
   <option> - - - - - - - - - - - - - - - - - </option>
   <option>2 Staff Page</option>
   <option>3 Rex Home Page</option>
   <option>4 Services</option>
   <option>5 Dive Travel</option>
   <option>6 Site Index</option>
   <option>7 Dive Charters</option>
    <option>8 Local Tides</option>
<option>9 Dive Links</option>
<option>10 Rex Marina</option>

</select><script language="JavaScript">
<!--
function goto_page1() {
   if (document.navform.elements[0].selectedIndex == 0)
      window.parent.self.status=" Goes Nowhere";
else if (document.navform.elements[0].selectedIndex == 1)
      window.parent.self.status=" Goes Nowhere";
else if (document.navform.elements[0].selectedIndex == 2)
     window.open("http://www.rexdivecenter.com/staff.htm", target="main");
else if (document.navform.elements[0].selectedIndex == 3)
      window.open("http://www.rexdivecenter.com", target="main");
else if (document.navform.elements[0].selectedIndex == 4)
      window.open("http://www.rexdivecenter.com/services.htm", target="main");
else if (document.navform.elements[0].selectedIndex == 5)
      window.open("http://www.rexdivecenter.com/travel.htm", target="main");
else if (document.navform.elements[0].selectedIndex == 6)
      window.open("http://www.rexdivecenter.com/table_of_contents.htm", target="main");
else if (document.navform.elements[0].selectedIndex == 7)
      window.open("http://www.rexdivecenter.com/charters.htm", target="main");
else if (document.navform.elements[0].selectedIndex == 8)
      window.open("http://www.rexdivecenter.com/todays_tides.htm", target="main");
else if (document.navform.elements[0].selectedIndex == 9)
      window.open("http://www.rexdivecenter.com/divelinks.htm", target="main");
else if (document.navform.elements[0].selectedIndex == 10)
      window.open("http://www.rexdivecenter.com/marina.htm", target="main");
}
// --></script> </p>
</form></td>


      <td width="33%" height="24" valign="top"><form name="gearform">
<p><select name="section" size="1" width="200" language="javascript" onchange="goto_page2();">
   <option selected value="Dive Gear...">Dive Gear...</option>
   <option> - - - - - - - - - - - - - - - - - </option>
   <option>2 Wetsuits</option>
   <option>3 Drysuits</option>
   <option>4 Accessories</option>
   <option>5 BC's</option>
   <option>6 Cameras</option>
   <option>7 Dive Computers</option>
   <option>8 Dive Lights</option>
   <option>9 Fins</option>
   <option>10 Guages/Consoles</option>
   <option>11 Regulators</option>
   <option>12 Masks/Snorkels</option>
   <option>13 Inflatables</option>

</select><script language="JavaScript"><!--
function goto_page2() {
   if (document.gearform.elements[0].selectedIndex == 0)
      window.parent.self.status=" Goes Nowhere";
   else if (document.gearform.elements[0].selectedIndex == 1)
      window.parent.self.status=" Goes Nowhere";

else if (document.gearform.elements[0].selectedIndex == 2)
      window.open("http://www.rexdivecenter.com/equipment/wetsuits/wetsuits_info.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 3)
      window.open("http://www.rexdivecenter.com/equipment/drysuits/drysuit_info.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 4)
      window.open("http://www.rexdivecenter.com/construction.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 5)
      window.open("http://www.rexdivecenter.com/equipment/bc_s/bc_info.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 6)
     window.open("http://www.rexdivecenter.com/equipment/cameras/aquashot3.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 7)
      window.open("http://www.rexdivecenter.com/equipment/dive_computers/dive_computer_info.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 8)
      window.open("http://www.rexdivecenter.com/equipment/dive_lights/dive_lights.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 9)
      window.open("http://www.rexdivecenter.com/equipment/fins/fins_info.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 10)
      window.open("http://www.rexdivecenter.com/equipment/gauges_consoles/gauges_consoles_info.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 11)
      window.open("http://www.rexdivecenter.com/equipment/regulators/regulator_info.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 12)
      window.open("http://www.rexdivecenter.com/equipment/masks_snorkels/masks_info.htm", target="main");
else if (document.gearform.elements[0].selectedIndex == 13)
      window.open("http://www.rexdivecenter.com/equipment/inflatables.htm", target="main");

}
// --></script> </p></td>
      <td width="35%" height="24" valign="top">Cell 3</td>



      <td width="16%" height="24" valign="top">Cell4</td>
    </tr>
  </table>
  </center>
</div>

</body>

</html>
0
 

Author Comment

by:DavidNPD
ID: 2757014
Excellent job thanks for the speedy response.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to handle long text strings in javascript or ajax 1 31
How would I do a website like this? 5 56
Input box width 6 26
AdminLTE with wordpress 15 60
This article discusses how to create an extensible mechanism for linked drop downs.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question