Copy link to clipboard
Copied
As the custom calculation script of the drop-down field enter the following:
event.target.required = this.getField("Registered In").valueAsString=="1";
Use this as the whole code:
if (this.getField("Registered In").valueAsString=="1") {
event.target.required = true;
event.target.display = display.visible;
} else {
event.target.required = false;
event.target.display = display.hidden;
event.value = event.target.defaultValue;
}
Copy link to clipboard
Copied
Copy link to clipboard
Copied
As the custom calculation script of the drop-down field enter the following:
event.target.required = this.getField("Registered In").valueAsString=="1";
Copy link to clipboard
Copied
Thank you. Works.
P.S. Is it possible to return the data from the drop-down menu (default) if you select the “Same” button after selecting “Different country (specify)” and choosing from the drop-down menu? A person can make a mistake when filling out.
Copy link to clipboard
Copied
Sure. Add this line to that code:
if (this.getField("Registered In").valueAsString=="0") event.value = event.target.defaultValue;
Copy link to clipboard
Copied
Thank you. Works great.
Copy link to clipboard
Copied
if (this.getField("Registered In").valueAsString=="0") event.value = event.target.defaultValue;
Can you add more to this code to make the drop-down menu hidden again?
Thank you.
Copy link to clipboard
Copied
Use this as the whole code:
if (this.getField("Registered In").valueAsString=="1") {
event.target.required = true;
event.target.display = display.visible;
} else {
event.target.required = false;
event.target.display = display.hidden;
event.value = event.target.defaultValue;
}
Copy link to clipboard
Copied
Perfect now.
Thank you.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Solved... Sorry. I have not changed the name of the field in the script. 🙂