These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Javascript variable information

Aimee
Registered: Jun 1 2008
Posts: 3
Answered

I am new to Javascript and need help creating a script. I am working in Adobe Acrobat v8 Professional.
I would like to take the value in A text box, the value in B text box and the value in C text box and have it populate text box D with the exact values I entered in A, B, and C. Then I would like text box E to have the same info as box D but I would change the font and size properties of the box.

i.e., box A = 2, box B = T, box C = 5 --- box D = 2T5.

Thank you.

My Product Information:
Acrobat Standard 8.1.2, Windows
jbfreels
Registered: Feb 19 2008
Posts: 63
this.getField("boxD").value = this.getField("boxA").valueAsString + this.getField("boxB").valueAsString + this.getField("boxC").valueAsString;
jbfreels
Registered: Feb 19 2008
Posts: 63
And then to make "boxE" the same as "boxD", you could simply do....

this.getField("boxE").value = this.getField("boxD").value = this.getField("boxA").valueAsString + this.getField("boxB").valueAsString + this.getField("boxC").valueAsString;

Make sure you use "valueAsString", that way if the fields contain integers they will not be summed.
Aimee
Registered: Jun 1 2008
Posts: 3
THANK YOU VERY MUCH for your help. It does exactly what I wanted in the pdf!