Add the value of two text fields to appear in a third text field.
Hello, I'm fairly new to javascript and have never used it within Adobe Acrobat before so I'm pretty lost. I'm using Acrobat Pro DC and I'm trying to take the user input from two text fields and add them together to show the sum in a third text field. What I have set up is three text fields with the names of "valueOne", "valueTwo", and "sum".
In the actions tab on the properties window for the valueOne field I have a trigger of Mouse Down and the action to run javascript, I wrote -
var firstValue = this.getField("valueOne").value;
I did the same on the second text field with -
var secondValue = this.getField("valueTwo").value;
Then for the third text field, which will show the sum, I'm not sure how to autofill it? I've tried something like -
event.value = (this.getField("valueOne + valueTwo").value=="") ? "";
It's not working - and I'm not sure how to have it just show up without using a trigger event?
Any advice would be much appreciated, thank you!
