Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-04-2002, 08:04 AM   PM User | #1
Janicelee
New to the CF scene

 
Join Date: Oct 2002
Location: Singapore
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Janicelee is an unknown quantity at this point
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
Janicelee is offline   Reply With Quote
Old 10-04-2002, 09:01 AM   PM User | #2
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
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.
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app

Last edited by glenngv; 10-04-2002 at 09:04 AM..
glenngv is offline   Reply With Quote
Old 10-07-2002, 07:40 AM   PM User | #3
Janicelee
New to the CF scene

 
Join Date: Oct 2002
Location: Singapore
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Janicelee is an unknown quantity at this point
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
Janicelee is offline   Reply With Quote
Old 10-07-2002, 01:17 PM   PM User | #4
Owl
New Coder

 
Join Date: Jun 2002
Posts: 62
Thanks: 0
Thanked 1 Time in 1 Post
Owl is an unknown quantity at this point
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
Owl is offline   Reply With Quote
Old 10-08-2002, 07:26 AM   PM User | #5
Janicelee
New to the CF scene

 
Join Date: Oct 2002
Location: Singapore
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Janicelee is an unknown quantity at this point
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
Janicelee is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:18 AM.


Advertisement
Log in to turn off these ads.