• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to edit text in a text field that is prefilled from a drop down selection

New Here ,
Aug 16, 2022 Aug 16, 2022

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;

Views

450

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 16, 2022 Aug 16, 2022

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 16, 2022 Aug 16, 2022

Copy link to clipboard

Copied

My apologies- Adobe Acrobat Standard 2017

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 17, 2022 Aug 17, 2022

Copy link to clipboard

Copied

Don't use a calculation script for this.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 17, 2022 Aug 17, 2022

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;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 17, 2022 Aug 17, 2022

Copy link to clipboard

Copied

This will not show export value in text field as OP wanted.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 17, 2022 Aug 17, 2022

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;

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 17, 2022 Aug 17, 2022

Copy link to clipboard

Copied

LATEST

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;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines