Skip to main content
jsimon050
Participant
February 28, 2016
Answered

Trying to create tally form

  • February 28, 2016
  • 1 reply
  • 757 views

I'm trying to create a form to track a token economy in Acrobat Pro DC. The amounts will be in whole number increments. I thought that I'd be able to assign a values to Button form fields, have them clicked, and have the corresponding value maintain a running total in a Text field. If this is possible, my skills are insufficient. Instead, I'm using Checkbox fields, assigning values to them, and using the Value is the sum function under to calculate tab. The limitation of this method, however, is that it changes the sum as I uncheck a box. I need this to not happen and I suspect that I'll need some javascript either in the Checkbox field, the Textbox field, or both. Thanks.

This topic has been closed for replies.
Correct answer try67

So you want to increment the value of a text field each time a button is clicked? That's certainly possible.

You can use something like this script as the Mouse Up event of the button. Let's assume the name of the text field is "Counter".

var f = this.getField("Counter");

f.value = Number(f.valueAsString)+1;

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
February 28, 2016

So you want to increment the value of a text field each time a button is clicked? That's certainly possible.

You can use something like this script as the Mouse Up event of the button. Let's assume the name of the text field is "Counter".

var f = this.getField("Counter");

f.value = Number(f.valueAsString)+1;

jsimon050
jsimon050Author
Participant
February 28, 2016

You, sir, are quite correct! Your help is greatly appreciated and I would like to know what you training you would suggest for a person wishing to code with JavaScript using Acrobat. Thank you very much!

try67
Community Expert
Community Expert
February 28, 2016