Solved

2 dropdowns on same frame wont work

Posted on 2000-04-27
2
154 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

690 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