Solved

2 dropdowns on same frame wont work

Posted on 2000-04-27
2
148 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now