Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

2 dropdowns on same frame wont work

Posted on 2000-04-27
2
Medium Priority
?
158 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 400 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

564 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