Copy link to clipboard
Copied
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.
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;
Copy link to clipboard
Copied
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;
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied