Setting multiple option boxes to the same value

wxdqz

New Member
Hi,

What I want to to do is this: I have a number of drop down combo boxes and want to be able to set them all to the same value with one click, I want them all to have the same value as the first option box (a sort of synchronizing). So I tried some stuff, but with no luck... My drop down combo boxes are called n_link[0] to n_link[x], yes a real array because I use it with PHP.

Here's what I got so far, the form is called 'bplisting':

function GlobalChoice(choice)
{
var objForm = document.bplisting;
var intIndex1 = objForm.elements[choice].selectedIndex;
var theElems = objForm.n_link[0].length;

for (i=1;i<theElems.length;i++)
{
objForm.elements[n_link].selectedIndex = intIndex1;
}
}

Could someone tell me what I am doing wrong? At the moment I am getting an error 'n_link.0 is null or not an object'. What is submitted to the function is the name of the first option box (with which the rest has to synchronize).

Big thanks in advance.

PS: All the drop down combo boxes have the same amount of options, with the same values, so they're all the same (it's for assigning attributes, so the list from which to choose from is the same everywhere.)
 
Back
Top