R
Rick W.
OK everyone, I know this is not orthodox but I have a situation where
there could be more than one drop-down option element with the same ID
in my document.
I am setting the value of that programatically in javascript using the
"getElementbyID" call.
However It only finds the first occurance and sets it. I need to be
able to set all of them,
there are some cases where it may show up 2 or 3 times in my document.
I have something like this.
function setallmatrix(matrixid,FC_option)
{
matrixoptions = document.getElementById(matrixid)
for(var i=0;i<matrixoptions.length;i++)
{
if(elements[x].id == matrixid)
{
matrixoptions.options[FC_option].selected = true;
}
}
As you can see I am trying to set a dropdown option control.
setting the first one like this works fine:
document.getElementById(matrixsizeop).options[FC_option].selected =
true;
but I have more than one on rare occasion.
Could someone please help,
I've tried all I know, and running out of time and options.
Rick
there could be more than one drop-down option element with the same ID
in my document.
I am setting the value of that programatically in javascript using the
"getElementbyID" call.
However It only finds the first occurance and sets it. I need to be
able to set all of them,
there are some cases where it may show up 2 or 3 times in my document.
I have something like this.
function setallmatrix(matrixid,FC_option)
{
matrixoptions = document.getElementById(matrixid)
for(var i=0;i<matrixoptions.length;i++)
{
if(elements[x].id == matrixid)
{
matrixoptions.options[FC_option].selected = true;
}
}
As you can see I am trying to set a dropdown option control.
setting the first one like this works fine:
document.getElementById(matrixsizeop).options[FC_option].selected =
true;
but I have more than one on rare occasion.
Could someone please help,
I've tried all I know, and running out of time and options.
Rick