Script not working to have second drop down populate from first drop down selection
var productChild = this.getField("Product Child");
var productParentValue = this.getField("Product Parent").value;
// Clear the options in the Product Child drop-down list
productChild.clearItems();
// Add the options based on the selected value in the Product Parent drop-down list
if (productParentValue == "1") {
productChild.addItem("Option 1a", "Option 1a");
productChild.addItem("Option 1b", "Option 1b");
} else if (productParentValue == "2") {
productChild.addItem("Option 2a", "Option 2a");
productChild.addItem("Option 2b", "Option 2b");
} else if (productParentValue == "3") {
productChild.addItem("Option 3a", "Option 3a");
productChild.addItem("Option 3b", "Option 3b");
}
Can anyone help with this code? I've tried everything I know how do to do. thank you!!
