Javascript: Validation Error
Hey thanks for reading.
I wrote a validation script for a dropdown field. If user selects x or y, an app alert asks for confirmation. If user selects no, I want the field to revert to y. But I'm receiving an: InvalidSetError: Set not possible, invalid or unknown specifically regarding the line that reverts the field value to y. I've tried referencing the export value of that dropdown option. still no luck.
What am I doing wrong?
if (event.value !== "X" && event.value !== "Y") {
var response = app.alert({
cMsg: "Please confirm:...",
nIcon: 3,
nType: 2,
cTitle: "selection",
arrButton: ["Yes", "No"]
});
if (response === 4) {
Additional.display = display.visible;
}
else if (response === 3) {
app.alert("Please enter your Y")
field.value = "Y";
Additional.display = display.hidden;
}}