Copy link to clipboard
Copied
I currently have a drop down menu (attorney name) with various selections. Each selection has a specific export value which is then prefilled into a text field (law firm). I have allowed users to enter custom text in the drop down field if their selection is not one of the options. The issue is, whatever is entered as the custom texts automatically transfers to the text field (law firm). I would like both of these fields to be editable.
The text field has a custom calculation script of:
event.value = this.getField("attorney name").valueAsString;
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
My apologies- Adobe Acrobat Standard 2017
Copy link to clipboard
Copied
Don't use a calculation script for this.
Copy link to clipboard
Copied
Remove that code and add the following as the Validation script of "attorney name" :
this.getField("law firm").value = event.value;
Copy link to clipboard
Copied
This will not show export value in text field as OP wanted.
Copy link to clipboard
Copied
Then use this:
var v = "";
for (var i=0; i<event.target.numItems; i++) {
if (event.target.getItemAt(i, false)==event.value) {
v = event.target.getItemAt(i, true);
}
}
this.getField("law firm").value = v;
Copy link to clipboard
Copied
Another option is to keep the calculation script, but change it to this:
if (event.source && event.source.name=="attorney name")
event.value = this.getField("attorney name").valueAsString;