Setting a required field based on a dropdown selection
So I've seen a few similar topics but nothing I've been able to try/modify that fit what I need so hoping someone can help me fix this:
- I have a dropdown menu with 7 options
- 2 of the 7 options need to make a separate text field REQUIRED
- If any of the other 5 options are selected the separate field text remains OPTIONAL
- To try to simplify this I set the Export Values of the 2 required items to REQ and the remainder to X
Here's what I have so far:
var spod = this.getField("Dept");
if (event.value=="Req") {
spod.required = true;
}
else if (event.value=="X") {
spod.required = false;
}
but each time I select either of the req options the dept field doesnt change. What am I doing wrong?
