Forum Moderators: open
else if (document.getElementById("Division").value >= 1) {
for (i = 0; i < workingstructurewithdivid.length; i++) {
var optn = document.createElement("OPTION");
optn.text = workingstructurewithdivid[i].substring(0,5);
optn.value = workingstructurewithdivid[i];
alert(i);
alert ("DIV:" + document.getElementById("Division").value);
alert (optn.value.substring(6,7));
if ((document.getElementById("Division").value == optn.value.substring(6,7))
&& optn.text != workingstructurewithdivid[i-1].substring(0,5)) { //dup check
document.getElementById("BusUnitLevels").options.add(optn);
}
}
}
It could mean that "document.getElementById("BusUnitLevels")" doesn't exist, or "document.getElementById("Division")" doesn't have a value, or ... anything within the loop that would trigger that undefined is not an object error.
Open the page in Firefox with Firebug installed, and it may give you a more specific line number where the real error is happening.