This script is used to alter one drop down box based on the data from the first drop down.
It worked earlier today, but then I made changes and saved it, and now it doesn't work. I think I undid all my changes, but I must be missing something obvious. Any idea what's wrong with this javascript?
if (this.rawValue == 0) {//SQ1
DropDownList2.clearItems();
DropDownList2.addItem("Single Occ", "0");
DropDownList2.addItem("Double Occ", "1");
} else (this.rawValue == 1) {//SD2
DropDownList2.clearItems();
DropDownList2.addItem("Single Occ", "0");
DropDownList2.addItem("Double Occ", "1");
DropDownList2.addItem("Triple Occ", "2");
DropDownList2.addItem("Quad Occ", "3");
}
if (this.rawValue == 0) {//SQ1
DropDownList2.clearItems();
DropDownList2.addItem("Single Occ", "0");
DropDownList2.addItem("Double Occ", "1");} else if (this.rawValue == 1) {//SD2
DropDownList2.clearItems();
DropDownList2.addItem("Single Occ", "0");
DropDownList2.addItem("Double Occ", "1");
DropDownList2.addItem("Triple Occ", "2");
DropDownList2.addItem("Quad Occ", "3");
}// the "switch" statement
switch{ Str(this.rawValue)) {
case: "0": //SQ1
DropDownList2.clearItems();
DropDownList2.addItem("Single Occ", "0");
DropDownList2.addItem("Double Occ", "1");
break;case "1": //SD2
DropDownList2.clearItems();
DropDownList2.addItem("Single Occ", "0");
DropDownList2.addItem("Double Occ", "1");
DropDownList2.addItem("Triple Occ", "2");
DropDownList2.addItem("Quad Occ", "3");
break;
default:
// error message can go here
break;
}
George Kaiser