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

Custom script for dropdown value for PDF Form

New Here ,
Oct 27, 2019 Oct 27, 2019

Copy link to clipboard

Copied

I am working on a form that calculates a bunch of different fields based on a few inputs (for a table top game, pathfider 2e if anyone is interested) I have 6 fields that generate a number (STR, DEX, CON, INT, WIS, CHA). I want to make a drop down in a different section of the form that has those are options, and will pull the number from the original field as the export value. So for instance, if you select STR from the downdown menu, I want that options Export Value to be the vlue from the field "STRMod". 

 

I tried usinng the field name i want to pull as the entry for the export value.

 

I also tried:

this.getField("STRMod").value

 

I also tried:

event.value = this.getField("STRMod").value

 

No avail

 

Any ideas? is this possible?

TOPICS
Acrobat SDK and JavaScript

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
community guidelines
Community Expert ,
Oct 27, 2019 Oct 27, 2019

Copy link to clipboard

Copied

LATEST

Then only way to set the export value of a list item, from a script, is with the field.setItems() function.

Here's the entry for it in the Acrobat JavaScript reference:

https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/#t=Acro12_MasterBook%2FJS_API_Acro...

 

You can read about programing lists here:

https://www.pdfscripting.com/public/List-Field-Usage-and-Handling.cfm

and Here (this one has a download exemple that shows how to set list values):

https://acrobatusers.com/tutorials/list_and_combo_in_lc

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
community guidelines