View Full Version : Dropdown Menu doesn't work in Netscape

10-04-2002, 09:04 AM
Dear ppl,

I need your help.
I have created a dropdown menu for my website. I found that it works in IE but can not works in Netscape. As my user may using netscape to view the website, pls help me to solve.

The URL is http://www.spyspy.com/NewGUI/CustomRegulations.htm

Pls choose a region, and then a country. it will link to the info of the selected country. Some country may not have info. So do not worry about this because it is not completed yet.


10-04-2002, 10:01 AM
the correct way to get the value of a selected item in a select tag:


so, in your case:

RegionIndex = control.options[control.selectedIndex].value;

and another advice:
dont name your form as form, it is a reserved word in Javascript. Better to avoid it than to encounter unexpected error.

and once you change the form name, refer to an element like this:

showRegion(this, document.formName.selectCountry)


showRegion(this, this.form.selectCountry)

all italics text should be changed to appropriate names used.

10-07-2002, 08:40 AM
Dear glenngv,

Thanks for your reply and advise. I have tried to replaced the codes that you suggested.
But i find that it is still does not work in Netscape. Howz..........
The error shows that Type "javascript" into location for details.
I can't figure out what does it mean. So stupid i am, right? :(

I will appreciate if you could help me again. thanks.
Anyone got suggestion? pls let me know. Thanks a lot...

The URL is http://www.spyspy.com/NewGUI/CustomRegulations.htm

10-07-2002, 02:17 PM
Hi Janicelee,

Replace showRegion function (the whole function) with this:
function showRegion(control, secondBox){

RegionIndex = control.options[control.selectedIndex].value;
//Empty the second dropdown box of any choices
for (var q = secondBox.options.length; q>=0; q--)
secondBox.options[q] = null;
//add default choice incase there are no values
secondBox[0] = new Option("[Select a country]", 0);

Group = eval("GroupItems"+RegionIndex);

for (x = 0; x < Group.length; x++)
secondBox[x+1] = new Option(Group[x], x)

if(document.layers) {
secondBox[0].selected = true
}( ) ( )

10-08-2002, 08:26 AM
Dear Owl,

Thanks for your help.
It has helped me to solve the problem.

I found that Netscape doesn't support some java script but IE can support. That's the difficulty for us to write the scripts, right?
But anyway, Thanks for your advise.

You are really good man! :thumbsup: