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

automatically populate from dropdown field

New Here ,
Mar 07, 2018 Mar 07, 2018

Copy link to clipboard

Copied

I would like a text box to automatically populate with a single letter refering to what was chosen in a dropdown menu ? how do i code this please?

drop down                text box

heli 1                              a

heli 2                              b

heli 3                              c

heli 4                              d

TOPICS
Acrobat SDK and JavaScript

Views

408

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 ,
Mar 07, 2018 Mar 07, 2018

Copy link to clipboard

Copied

Put these letters as the export values of the items in the drop-down, and then use this code as the custom calculation script of the text field:

event.value = this.getField("dropdown").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
New Here ,
Mar 07, 2018 Mar 07, 2018

Copy link to clipboard

Copied

makes sense but its not working

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 ,
Mar 07, 2018 Mar 07, 2018

Copy link to clipboard

Copied

My bad !!! it works !!!!!! thank you so much

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 ,
Mar 30, 2018 Mar 30, 2018

Copy link to clipboard

Copied

Is there a way once this script is set up to allow the user to overwrite that field with a custom entry?  This works EXCELLENT but there are a few cases in my process where a custom entry into that field would still be necessary at times but it seems that every time I try to enter something in it is just overwritten by the script again.  Thanks for any help you might have!

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 ,
Mar 30, 2018 Mar 30, 2018

Copy link to clipboard

Copied

Add this line of code before the current one:

if (event.source && event.source.name=="dropdown")

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 ,
Mar 30, 2018 Mar 30, 2018

Copy link to clipboard

Copied

LATEST

Excellent!!! You just made my day.  Thanks! I'm not very good at code at all (meaning I have no idea what I'm doing ever) but this worked great.  Thanks a lot!

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