Skip to main content
bbpatch
Participating Frequently
January 22, 2018
Answered

Setting a Checkbox Export Value to a Value in another field.

  • January 22, 2018
  • 1 reply
  • 20818 views

Hello! How might I go about setting a Checkbox's exportValue to the value placed in another text field? The value in that text field will change periodically, so I would want that exportValue to change with it.

I have a D&D character sheet that auto-sums the skill checks. The checkbox will represent if a character is proficient with said skill. So if that box is checked, I want it to add the proficiency bonus.

Thank you!

This topic has been closed for replies.
Correct answer Thom Parker

The export value is set with the "exportValues" property, but this property must be an array, cause it's used for radio buttons as well.

Put this script in the Validate script for the field that will set the check box export:

this.getField("Checkbox").exportValues = [event.value];

Don't forget to change "Checkbox" to the name of your fields

1 reply

Thom Parker
Thom ParkerCorrect answer
Adobe Expert
January 22, 2018

The export value is set with the "exportValues" property, but this property must be an array, cause it's used for radio buttons as well.

Put this script in the Validate script for the field that will set the check box export:

this.getField("Checkbox").exportValues = [event.value];

Don't forget to change "Checkbox" to the name of your fields

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
bbpatch
bbpatchAuthor
Participating Frequently
January 25, 2018

Thank you, Thom,

I appreciate your response. I have placed that script in the Validate script for the "PROF" field. I am still unsure of (and new to) the array property in JavaScript. Attached is a screenshot of a portion of the sheet. Hope this helps visualize what I cannot verbalize correctly.

I basically am just focusing on the very first skill in the Skill Proficiency table, "Acrobatics". Once I figure out the scripts and things, I will complete the rest of the skills. I'm sure I may have to rename some checkboxes and fields, as well.

Thom Parker
Adobe Expert
January 25, 2018

Is this another question? Or is there something about my answer you don't understand?

Please be clear.

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