I have a page showing dynamic generation of a SELECT box using
JavaScript. See http://www.softouch.on.ca/dynamic.html.
Using Mozilla et al, choosing an option from both lists will result in
the correct response when 'Show Me' is clicked. But IE only shows the
result from the first SELECT box. Any ideas why / how to fix this?
The function I'm using:
function updateList(what )
{
// This dynamically populates the CurrentPosition Picks select box in
the resume page
// depending on what one was selected in the LevelOne select box.
for (var i=0;i<document. Resume.CurrentP ositionPicks.le ngth;i++) //
empty the list
{
document.Resume .CurrentPositio nPicks.options. length=0;
}
// LevelOnePicks is the top level select box in the resume form
// CurrentPosition Picks is the dynamically generated select list
var CurrentPosition Picks=document. Resume.CurrentP ositionPicks;
for (var i=0;i<document. Resume.LevelOne Picks.length;i+ +)
{
if (document.Resum e.LevelOnePicks .options[i].selected)
{
var ThisList=eval(T opLevel[i].Name); // get the array name to use
for (var j=0; j < ThisList.length ; j++)
{
CurrentPosition Picks.options[j]=new Option;
CurrentPosition Picks.options[j].text=ThisList[j];
}
}
}
}
JavaScript. See http://www.softouch.on.ca/dynamic.html.
Using Mozilla et al, choosing an option from both lists will result in
the correct response when 'Show Me' is clicked. But IE only shows the
result from the first SELECT box. Any ideas why / how to fix this?
The function I'm using:
function updateList(what )
{
// This dynamically populates the CurrentPosition Picks select box in
the resume page
// depending on what one was selected in the LevelOne select box.
for (var i=0;i<document. Resume.CurrentP ositionPicks.le ngth;i++) //
empty the list
{
document.Resume .CurrentPositio nPicks.options. length=0;
}
// LevelOnePicks is the top level select box in the resume form
// CurrentPosition Picks is the dynamically generated select list
var CurrentPosition Picks=document. Resume.CurrentP ositionPicks;
for (var i=0;i<document. Resume.LevelOne Picks.length;i+ +)
{
if (document.Resum e.LevelOnePicks .options[i].selected)
{
var ThisList=eval(T opLevel[i].Name); // get the array name to use
for (var j=0; j < ThisList.length ; j++)
{
CurrentPosition Picks.options[j]=new Option;
CurrentPosition Picks.options[j].text=ThisList[j];
}
}
}
}
Comment