How do I select an item in a drop-down list and the result displayed in a text field?

Explorer ,
Aug 08, 2018 Aug 08, 2018

Copy link to clipboard

Copied

Expensive, good afternoon.

I am creating a material request form with 08 columns and 10 rows. The first column refers to the materials, where I created a drop-down list with 534 lists. Each item has a code. I want to click on an item in the drop-down list and the code for this item appears in the second column in a text field. How to do this? And getting, I want to repeat this dropdown list and text field in the 10 lines. it's possible?

  Hugs, Berg

TOPICS
Acrobat SDK and JavaScript, Windows

Views

141

Likes

translate

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
Adobe Community Professional ,
Aug 08, 2018 Aug 08, 2018

Copy link to clipboard

Copied

Likes

translate

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
Explorer ,
Aug 08, 2018 Aug 08, 2018

Copy link to clipboard

Copied

To access the files and tutorials of PDFScripting.com, only if it is a member?

How do I access these files if I am a member of the site?

Likes

translate

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
Adobe Community Professional ,
Aug 08, 2018 Aug 08, 2018

Copy link to clipboard

Copied

Most of the detailed scripts, videos, tools, sample files, etc. are for members only. But all the basic info about each topic is free. In fact, the list handling page linked provides quite a bit of material, including the answer to your questions, which is that the field value of the list is the export value of the selected item. So just add this to the format or validate script of the dropdown.

this.getField("TextField").value = event.value;

Where "TextField" is the field you want the value displayed in.

Likes

translate

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
Adobe Community Professional ,
Aug 08, 2018 Aug 08, 2018

Copy link to clipboard

Copied

You will be using custom JavaScript code for this, so field naming can make this task easier or harder.

For on row. Assuming the drop down field is maned "Item" and the text field is named "Code". for the Action "On Blur" add the following JavaScript:

this.getField("Code").value = event.value;

One can also have the code change as one moves up or down the list of items. Set the option for the dropd own to "Commit selected value immediately". Then add the following cod to the "Custom keystroke":

if(event.willCommit != true) {

this.getField("Code").value = event.changeEx;

}

Likes

translate

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