Autopopulate text field (editable) based on dropdown selection

Community Beginner ,
Sep 09, 2020

Copy link to clipboard

Copied

Hello,

 

I have a dropdown field called Department with 10 or so options and a text field called Manager. I have defined the export value per option under Department field and added the Custom Calculation script as event.value = this.getField("Department").value; to autopopulate the respective Manager field.

 

This is working fine but I want the user to be able to edit/overtype the autopopulated value in the Manager field and save the manually entered Manager name. Any suggestions with Acrobat DC Standard PDF form?

Adobe Community Professional
Correct answer by ls_rbls | Adobe Community Professional

Use this method;

 

if(event.source&&event.source.name=="Department"){
event.value = this.getField("Department").value;
 }
TOPICS
Acrobat SDK and JavaScript, How to, PDF forms

Views

57

Likes

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

Autopopulate text field (editable) based on dropdown selection

Community Beginner ,
Sep 09, 2020

Copy link to clipboard

Copied

Hello,

 

I have a dropdown field called Department with 10 or so options and a text field called Manager. I have defined the export value per option under Department field and added the Custom Calculation script as event.value = this.getField("Department").value; to autopopulate the respective Manager field.

 

This is working fine but I want the user to be able to edit/overtype the autopopulated value in the Manager field and save the manually entered Manager name. Any suggestions with Acrobat DC Standard PDF form?

Adobe Community Professional
Correct answer by ls_rbls | Adobe Community Professional

Use this method;

 

if(event.source&&event.source.name=="Department"){
event.value = this.getField("Department").value;
 }
TOPICS
Acrobat SDK and JavaScript, How to, PDF forms

Views

58

Likes

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
Sep 09, 2020 0
Adobe Community Professional ,
Sep 10, 2020

Copy link to clipboard

Copied

Use this method;

 

if(event.source&&event.source.name=="Department"){
event.value = this.getField("Department").value;
 }

Likes

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
Reply
Loading...
Sep 10, 2020 1
Community Beginner ,
Sep 10, 2020

Copy link to clipboard

Copied

Works well. Thank you so much!

Likes

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
Reply
Loading...
Sep 10, 2020 1