Skip to main content
This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Jul 7, 2016 7:32 PM UTC

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;

16 replies

JR Boulay
Community Expert
Community Expert
Jan 19, 2023 11:47 PM UTC

No script required, you can use the simplified notation:

(JJPC\ MCKTOTAL1 + JDPC\ MCKTOTAL1) * 0.5

 

The backslash is used to escape the space character.

 

Translate
Acrobate du PDF, InDesigner et Photoshopographe
Inspiring
Jul 7, 2016 11:03 AM UTC

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?

Translate
try67
Community Expert
Community Expert
Jul 7, 2016 11:07 AM UTC

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

JJPC\ MCKTOTAL1

Translate