Copy link to clipboard
Copied
Hello here for a new topic!
I am still on my character sheet for one of my role-playing games and i need some calculations done in some fields of my form:
For example I would like in a field to appear:
(sum of several other fields) + 2 or (sum of several other fields) - 10
I manage to calculate the sum of several fields without problem by going through Adobe Acrobat DC but i don't know how doing if my calculation is a little more complicated like adding 2 to the resultIs a Javascript script required ?
Thank you for your help and advices
You can use this calculation script:
var v1 = getField("field1").value;
var v2 = getField("field2").value;
var v3 = getField("field3").value;
var v4 = 2;
event.value = v1 + v2 + v3 + v4;
Copy link to clipboard
Copied
Hello here for a new topic!
I am still on my character sheet for one of my role-playing games and i need some calculations done in some fields of my form:
For example I would like in a field to appear:
(sum of several other fields) + 2 or (sum of several other fields) - 10
I manage to calculate the sum of several fields without problem by going through Adobe Acrobat DC but i don't know how doing if my calculation is a little more complicated like adding 2 to the resultIs a Javascript script required ?
Thank you for your help and advices
You can use this calculation script:
var v1 = getField("field1").value;
var v2 = getField("field2").value;
var v3 = getField("field3").value;
var v4 = 2;
event.value = v1 + v2 + v3 + v4;
Copy link to clipboard
Copied
If the adder for a given sum-of-fields is always the same (as in your example '+2'), you can do it without (having to write) javascript by adding a hidden, read-only text field with a value of 2 to the document, and include it in the fields named in your calculation.
Copy link to clipboard
Copied
You can use this calculation script:
var v1 = getField("field1").value;
var v2 = getField("field2").value;
var v3 = getField("field3").value;
var v4 = 2;
event.value = v1 + v2 + v3 + v4;