Skip to main content
This topic has been closed for replies.
Correct answer try67

The basic structure of the script would be:

var v1 = Number(this.getField("FieldName1").valueAsString);

var v2 = Number(this.getField("FieldName2").valueAsString);

event.value = (v1+v2)/2;

2 replies

JR Boulay
Community Expert
Community Expert
January 19, 2023

No script required, you can use the simplified notation:

(JJPC\ MCKTOTAL1 + JDPC\ MCKTOTAL1) * 0.5

 

The backslash is used to escape the space character.

 

Acrobate du PDF, InDesigner et Photoshopographe
Inspiring
July 7, 2016

You could put your calculation into the "Simplified Field Notation" method option.

If I remember correctly adding a number to itself and dividing by 2 will result in the number.

Have you looks at any of the free tutorials or videos on form creation?

try67
Community Expert
Community Expert
July 7, 2016

If the field names contain spaces, though, you'll need to escape them, like this:

JJPC\ MCKTOTAL1