Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Oct 2002
    Location
    Singapore
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dropdown Menu doesn't work in Netscape

    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.

    thanks

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,968
    Thanks
    0
    Thanked 236 Times in 233 Posts
    the correct way to get the value of a selected item in a select tag:

    document.formName.selectName.options[document.formName.selectName.selectedIndex].value

    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)

    or

    showRegion(this, this.form.selectCountry)

    all italics text should be changed to appropriate names used.

  • #3
    New to the CF scene
    Join Date
    Oct 2002
    Location
    Singapore
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    Owl
    Owl is offline
    New Coder
    Join Date
    Jun 2002
    Posts
    62
    Thanks
    0
    Thanked 1 Time in 1 Post
    Hi Janicelee,

    Replace showRegion function (the whole function) with this:
    Code:
    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 		
    		   history.go(0); 
    		}			
    }
    ( ) ( )
    >>V

  • #5
    New to the CF scene
    Join Date
    Oct 2002
    Location
    Singapore
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!




    Janice


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •