Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

netscape not reading option value tag

Status
Not open for further replies.

riffy

Programmer
Mar 29, 2001
106
US
Hi all,

I have two dropdowns, one populated by the other. The first dropdown has 4 items say for example A,B,C,D. After the user selects one of these, the second dropdown is populated with more options. When the user selects an item from the second dropdown, and clicks on a submit button a page with info relevant to that item is displayed. This works fine in IE but Netscape brings up a null.html file. Any suggestions on how to get around this?

Also, say one of the items in the second dropdown is called HID Bases. After the user selects that and clicks on the submit button, it should bring up a page called hid_bases.html...however I can't seem to figure out how to program that, to make it work I had to rename the page to what is EXACTLY in the dropdown...is there a way to make the link access a page with a different name?

Thanks
Arif
 
riffy,

You need to have the <form> and </form> tags.
Netscape is not very forgiving.


fengshui_1998
 
i do, if you want i can post all my code
 
Here is the code that I'm using for this:
bulbs.html - file with the form

Code:
<!--#include virtual=&quot;advancedsearch.js&quot;-->
<table width=&quot;164&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; background=&quot;images/leftnav.jpg&quot;>
 <tr> 
  <td width=&quot;5&quot;> </td>
  <td width=&quot;159&quot; height=&quot;315&quot;> 
   <script language=&quot;javascript&quot;>
   <!--
   function myFunction() {
    location.href = document.selectform.infomenu.value + '.html';
    return false;
   }
   //-->
   </script>
   <form method=get name=&quot;selectform&quot; onSubmit=&quot;return myFunction()&quot;>
   <br>
   <font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;><b>Lamp Family:</b></font><br>
    <select name=&quot;select&quot; onChange=&quot;Dropdown(this.form.select.options[this.form.select.selectedIndex].value)&quot;>
     <option value=&quot;&quot;>Select Lamp Family</option>
     <option value=&quot;0&quot;>Fluorescent</option>
     <option value=&quot;1&quot;>Incandescent</option>
     <option value=&quot;2&quot;>CFL</option>
     <option value=&quot;3&quot;>HID</option>
    </select>
    <br>
    <font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;><b>Properties:</b></font><br>
    <select name=&quot;infomenu&quot;>
     <option value=&quot;&quot; selected>Select Family First</option>
     <option></option>
     <option></option>
     <option></option>
     <option></option>
     <option></option>
     <option></option>
     <option></option>
    </select>
    <br>
    <input type=image src=&quot;/radiant/database/images/search_new.gif&quot; width=&quot;62&quot; height=&quot;22&quot; name=&quot;image&quot; border=&quot;0&quot;>
   </form>
   <script language=&quot;JavaScript&quot;>
   <!--
   document.selectform.reset();
   //--></script>
  </td>
 </tr>
</table>

advancedsearch.js - the file that populates the second dropdown

Code:
<script src='menuarrays.js' language=javascript></script>
<script language=javascript>
<!--
typeselected=0;
function initialize() {
 document.selectform.infomenu.options[0].text = &quot;Select Family First&quot;;
};

function Dropdown(type) {
 if (type) {
  //Populate Property Dropdown
  document.selectform.infomenu.options.length = info[type].length + 1;
  document.selectform.infomenu.options[0].text = &quot;Select Property&quot;;
  for(var i=0; i<info[type].length; i++) {
   document.selectform.infomenu.options[i + 1].text = info[type][i];
   document.selectform.infomenu.options[i + 1].value = info[type][i];
  }
  document.selectform.infomenu.selectedIndex = 0;
 } 
 else { initialize(); return false; }
}

//-->
</script>

menuarrays.js - lists the values for the second dropdown

Code:
/*
0 - Fluorescent
1 - Incandescent
2 - Cfl
3 - HID

*/

info = new Array(4);
info[0] = new Array(&quot;FluorBases&quot;, &quot;FluorLamps&quot;);
info[1] = new Array(&quot;Incan_Bases&quot;, &quot;Incan_Lamps&quot;, &quot;Incan_Filaments&quot;);
info[2] = new Array(&quot;CFL_Lamps&quot;);
info[3] = new Array(&quot;HID_Bases&quot;, &quot;HID_Lamps&quot;);

thanks guys, hope someone can help me :)s-)
 
hey guys,
sorry to keep reposting to my own post but i fixed the netscape problem...however I'm still curious as to whether I can make the option in the menu call a page with a different name than the selected item...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top