Copy link to clipboard
Copied
I have a form with a drop down menu. If a user selects "Extender" or "Change Order" from the dropdown menu, I want to make a text field required to be filled in before they can submit the form. I have the javascript that follows in the custom validation script box of the dropdown properties.
this.getField("TargetProject").required = (event.value=="Extender");
This script I can make work for one option only. How can it be modified to work with a second option?
My list of options is the following:
Blank (default)
New
Change Order
Extender
Contract
The two bold options need to trigger the required text field.
Below are screenshots of the dropdown properties boxes.
Any help would be greatly appreciated.
Try this:
this.getField("TargetProject").required = event.value == "Extender" || event.value == "Change Order" ? true : false;
You don't need the last part of the code. This is sufficient:
this.getField("TargetProject").required = (event.value == "Extender" || event.value == "Change Order");
Copy link to clipboard
Copied
Try this:
this.getField("TargetProject").required = event.value == "Extender" || event.value == "Change Order" ? true : false;
Copy link to clipboard
Copied
You don't need the last part of the code. This is sufficient:
this.getField("TargetProject").required = (event.value == "Extender" || event.value == "Change Order");