Hey,
What I’m trying to do is, based on a user selection from a drop down, dynamically show a div and it’s contents. This is a short version of what I’m doing so code is missing.
I have the select with the onChange
[CODE]<select id=”program” tabindex=”2″ onChange=”reveal(choice)” name=”program”>
Then I have the div with the name
[CODE]<div id=”prerequisites_div”> </div>
and then I have the function that handles the processing
[CODE]function reveal(chosen)
{
var n=1;
len = document.form1.program.length;
i = 0;
chosen = “none”;
for (i = 0; i < len; i++)
{
if (document.form1.program[i].selected)
{
chosen = document.form1.program[i].value
}
}
if (chosen == “BSN”)
{
prerequisites_div.innerHTML = prerequisites_div.innerHTML +
“<td align=’middle’ bgcolor=’white’ colspan=’2′>….on and on to this” + n
}
else
{
return false;
}
}
Can someone help me see this through or steer in the right way to get this accomplished.