Why are you putting the script right there? Wouldn't it be better off in the head section? Perhaps that's related, though i'm not an expert on script positioning...
Also, to allow for expansion of the script, this
Code:
if (document.test.dropdown.selectedIndex=="1") {
document.getElementById("div1").style.display = "block"
}
if (document.test.dropdown.selectedIndex=="2") {
document.getElementById("div2").style.display = "block"
}
should be rewritten as:
Code:
document.getElementById("div"+document.test.dropdown.selectedIndex).style.display = "block";
Additionally, this:
<input type="button" value="Change" name="B1" onclick="change()">
is totally worthless.
It just does it again... you already have "onchange", and this is a button to submit the current setup again... take that out... doesn't do anything.
UNLESS want a button to click instead of auto-changing when the dropdown changes.
Bookmarks