problem displaying the options in selectbox while creating it dynamically in opera9.2

ramchml's Avatar, Join Date: Oct 2007
Newbie Member
i have two select boxes based on the selected value in one select box it should display the maximum options in the other select box.
i used javascript onClick for the first time it displays correct values again when i go back and change the value in the 1st selectbox the 2nd select box display previous values only.it works in all the browsers except opera.
my code is
Code:
function CalBasedMaxVal(selVal,changedVal,maxiVal,DefVal)
{
var CalBasedSelValue=selVal.selectedIndex+1;
var defaultText = '-['+lang_text_ary['default']+']';
var optionName;
while (changedVal.options.length)
{
changedVal.remove(0);
changedVal.options[0] = null;
}
for (var i=1; i<=maxiVal; i++)
{
if(i==DefVal)
{
optionName = new Option(i+defaultText, i, false, true);
}
else
{
optionName = new Option(i, i, false, false);
}
changedVal.options[changedVal.length] = optionName;
}
}

Last edited by shabbir; 12Oct2007 at 22:21.. Reason: Code block
0
Rexy93's Avatar, Join Date: Oct 2007
Go4Expert Member
I honestly can't help you witth this one as I don't see a problem in the coding. Maybe if you update to the latest Opera it should work because different browsers show things differently.

Just try to update Opera.