Custom script for dropdown value for PDF Form

New Here ,
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, PDF forms

Views

30

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

Custom script for dropdown value for PDF Form

New Here ,
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, PDF forms

Views

31

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
Oct 27, 2019 0
Adobe Community Professional ,
Oct 27, 2019

Copy link to clipboard

Copied

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

 

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...
Oct 27, 2019 0