View Full Version : scripting conflict on dropdown boxes
crustylog
11-16-2002, 11:17 AM
can anyone help.
i have 2 dropdown boxes and everything works fine when run on their own, but put them both on the same page and when i click on the left one, the details come up in the right one. i've been pulling my hair out for the past 2 hrs trying to figure it out. obviously it's some thing simple.
PauletteB
11-16-2002, 03:43 PM
Your form, function, and object names need to be different:
<form name="dynamiccombo">
<form name="dynamiccombo2">
You have only done that to your form name.
Do the same to the functions and the objects...
Example:
function gothere()
cacheobj
stage2
Probably others as well...
crustylog
11-16-2002, 03:55 PM
any chance of correcting where i went wrong so i can cross referance it with my original and spot my mistake ?
cheers
PauletteB
11-16-2002, 05:41 PM
The intent of the script is to have any of the Level I categories open up a secondary (Level II) choice within the same drop-down.
Seems that you expect the second drop-down to list a choice depending on the Postal Code selection of the first box.
If this is so, the script is not designed for that. You would need a different script....
To open in the same drop-down, each category needs a sub category which means (in your case) a totally different script as you basically have only one sub-category.
crustylog
11-16-2002, 05:51 PM
no, the object of the right hand script is as you say to give you a second choice, dependant upon the first choice. but this script should be totally independant from the first.
but at the moment if you choose something from the first dropdown, it changes the contents in the second (right) dropdown. this is not what i want.
PauletteB
11-16-2002, 06:34 PM
if you choose something from the first dropdown, it changes the contents in the second (right) dropdown. this is not what i want.
what do you want to happen?
crustylog
11-16-2002, 07:20 PM
on the attachment there is 2 dropdown boxes.
the one on the left which is the postcodes / a-z suppliers is just for that as it is only 1 level.
the one on the right, (with just random stuff at the moment); is needed as it is a 2 level drop down.
the problem i am having is if for instance i click on a-z suppliers, the details are coming up in the 2 level box; which needs to be independant. am i making any sense ?
PauletteB
11-16-2002, 08:42 PM
Try this... (http://www.mts.net/~unum/files/trythis.zip)
A few other lines were changed...
crustylog
11-17-2002, 10:07 AM
fantastic, works a dream.
i spotted exactly where i was going wrong, and i can assure you; i won't bloody forget this lesson.
one quick thing, on the right hand combo, you can pick from the first level, which takes you to the second level, but as soon as you click on any items it takes you straight there without clicking the "GO" button. any ideas (if not i can live with it)
but anyway pauletteb, thanks a lot for your time, you'v been a great help.
PauletteB
11-17-2002, 12:55 PM
I had noticed that as well, but since the script does the same on the demo at javascriptkit.com, it likely was the intention(?) of the author.
One could modify the code, but this is a copyright issue and it would be best for you to contact the author.
I actually changed very little to make the script work; basically renamed the functions and the objects.
Enjoy...
Paulette
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.