Click to See Complete Forum and Search --> : Change select from other select


Brian
01-23-2001, 04:05 PM
I am able to change what is selected in one select box when changing the selection
in another select box using the onChange event in IE, but it does not work
in Netscape. By passing
a value to the following line of code, it does nothing in Netscape:

document.general.SelectObjectName.options.value = passedValue;

How can I get this to work in Netscape and IE?

Thanks,

Brian

Russell Jones
01-24-2001, 03:48 PM
Just a guess, but it looks like you're missing an index value. The code
should be:
document.general.SelectObjectName.options[index].value = passedValue;


"Brian" <bminisi@accessgroup.org> wrote in message
news:3a6de423$1@news.devx.com...
>
> I am able to change what is selected in one select box when changing the
selection
> in another select box using the onChange event in IE, but it does not
work
> in Netscape. By passing
> a value to the following line of code, it does nothing in Netscape:
>
> document.general.SelectObjectName.options.value = passedValue;
>
> How can I get this to work in Netscape and IE?
>
> Thanks,
>
> Brian

Frederiek
01-26-2001, 12:06 PM
The correct syntax is:
document.formName.selectName.options[document.formName.selectName.selectedIndex].value

where you have to change "formName" and "selectName" to respectively the
names of your form and select box.

cya
Frederiek


"Russell Jones" <arj1@northstate.net> wrote:
>Just a guess, but it looks like you're missing an index value. The code
>should be:
>document.general.SelectObjectName.options[index].value = passedValue;
>
>
>"Brian" <bminisi@accessgroup.org> wrote in message
>news:3a6de423$1@news.devx.com...
>>
>> I am able to change what is selected in one select box when changing the
>selection
>> in another select box using the onChange event in IE, but it does not
>work
>> in Netscape. By passing
>> a value to the following line of code, it does nothing in Netscape:
>>
>> document.general.SelectObjectName.options.value = passedValue;
>>
>> How can I get this to work in Netscape and IE?
>>
>> Thanks,
>>
>> Brian
>
>