Indium
08-29-2002, 02:47 AM
I have put some javascript together which will dynamically fill the options of a dropwdown menu based on the selection made in a another dropdown menu. The selections are stored in an array. The first form containing the first menu passes the selectedIndex (i) to the following function which populates the second menu:
for(j=0;j<hyperlink[i].length;j++)
{
document.subMenu.menu2.options[j] = new Option(hyperlink[i][j]);
}
hyperlink is a 2d array, e.g. hyperlink = new array(choice1, choice2,...) and choice1 = new Array("selection1","selection2",...)
It works fine in IE6 and more or less in NN6.1, but it's not quite dynamic in NN4.79 (what a surprise!).
If I leave out the option tags in the form for the second menu, the following happens:
After making the selection in the first dropdown menu, no dynamic population of the second menu appears to have occurred. When the second menu is selected a narrow black line is produced, almost as though the selections have been compressed into nothing.
If I put one option tag in, e.g. <option>Make a selection</option> the following happens:
When I click on the second menu (the supposed dynamic one) it looks like a scroll box (with a size = 1) is produced which contains the selections. It also has blue scrolling arrows reminiscant of win XP style. The dropdown menu arrow box has the regular old NN brown color.
Anybody know of a NN bug or a quirk that might be casusing this.
for(j=0;j<hyperlink[i].length;j++)
{
document.subMenu.menu2.options[j] = new Option(hyperlink[i][j]);
}
hyperlink is a 2d array, e.g. hyperlink = new array(choice1, choice2,...) and choice1 = new Array("selection1","selection2",...)
It works fine in IE6 and more or less in NN6.1, but it's not quite dynamic in NN4.79 (what a surprise!).
If I leave out the option tags in the form for the second menu, the following happens:
After making the selection in the first dropdown menu, no dynamic population of the second menu appears to have occurred. When the second menu is selected a narrow black line is produced, almost as though the selections have been compressed into nothing.
If I put one option tag in, e.g. <option>Make a selection</option> the following happens:
When I click on the second menu (the supposed dynamic one) it looks like a scroll box (with a size = 1) is produced which contains the selections. It also has blue scrolling arrows reminiscant of win XP style. The dropdown menu arrow box has the regular old NN brown color.
Anybody know of a NN bug or a quirk that might be casusing this.