Copy link to clipboard
Copied
If "employed" is selected in the dropdown, Make the employer name field required? How do I achieve this?
Copy link to clipboard
Copied
When you post a question you always need to tell the Adobe program you are using
There are MANY programs in a full subscription, plus other non-subscription programs
Please post the exact name of the Adobe program you use so a Moderator may move this message to that forum
Copy link to clipboard
Copied
I am using Adobe Acrobat Pro DC.
Copy link to clipboard
Copied
++Edited Reply (added "return.rc = true;" to the second example script
Hi,
You may be able to achieve that with a validation script or a custom calculation script.
In the example below, I am running a validation script event from the dropdown menu field:
event.rc = true;
if (event.value != "Employer") {
this.getField("employer").required = false;
} else {
this.getField("employer").required = true;
}
A more concise, maybe more elegant way, with same result is shown below expressed in a single line of code:
event.rc = true; (event.value != "Employer") ? this.getField("employer").required = false : this.getField("employer").required = true;
Copy link to clipboard
Copied
There's no need to add
event.rc = true;
Copy link to clipboard
Copied
Thank you Try67.
For some unknown reason to me the script wasn't working as intended without that line when used as validation script.