PDA

View Full Version : 2 x double combo box script one one page


JustAsking
11-08-2002, 01:46 PM
When I use the two combo box scripts on the one page it is not working properly:

1. When i select an option from the second combo box the values for that selection are being taken form the values in the first dropdown box

For example you have first combo box

Option --> News sites

Selection --> cnn.com
--> yahoo.com

Second dropdown

Option --> Script sites

Selection --> javascriptkit.com
--> dynamicdrive.com

When put on the same page the selection for "Script sites" will have the values from the first dropdown (cnn.com, yahoo.com)

It has to be a variable conflict or something just can't find it.

I have attached a file with two combo box scripts on the one page to test if you like.

joh6nn
11-08-2002, 10:03 PM
at a quick guess:

you name both arrays the same thing.

var groups=document.opplan.opplan2.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()

var groups=document.review.review2.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()

JustAsking
11-09-2002, 08:28 AM
I have changed one of the array names and the other variables as below, but the problem still happens.


var groups=document.opplan.opplan2.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()


var groups2=document.review.review2.options.length
var group2=new Array(groups2)
for (i=0; i<groups2; i++)
group2[i]=new Array()

Any ideas?