Go4Expert

Go4Expert (http://www.go4expert.com/)
-   JavaScript and AJAX (http://www.go4expert.com/forums/javascript/)
-   -   problem displaying the options in selectbox while creating it dynamically in opera9.2 (http://www.go4expert.com/forums/displaying-options-selectbox-creating-t6804/)

ramchml 12Oct2007 19:22

problem displaying the options in selectbox while creating it dynamically in opera9.2
 
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;
}
}


Rexy93 29Oct2007 02:37

Re: problem displaying the options in selectbox while creating it dynamically in opera9.2
 
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.


All times are GMT +5.5. The time now is 00:38.