Skip to main content
Participant
February 12, 2019
Answered

calculate subtotal fields

  • February 12, 2019
  • 1 reply
  • 1555 views

I've created a form where our technicians can select one of three boxes for courses they are required to take. Depending on the box they select a field will either populate with $0 or a specific dollar amount. I now want to add the fields with the dollar amounts and I can't get adobe to do that for me.

Here is the sample script I'm using based on something I found online: event.value=this.getField(“Text37”).value+this.getField(“Text38”).value;

It's not wrking. Any help would be greatly appreciated.

This topic has been closed for replies.
Correct answer try67

I can't use either - nothing stays in the boxes so it's impossible to use both at the same time. Here's a picture of what I've entered in the calculation script box and another showing that's disappeared after I click OK. Very frustrating!


Sounds like the file got corrupt. Did you at any point edit the scripts via the Edit All JavaScripts command?

1 reply

try67
Community Expert
Community Expert
February 12, 2019

Use this:

event.value=Number(this.getField("Text37").value)+Number(this.getField("Text38").value);

try67
Community Expert
Community Expert
February 12, 2019

PS. Or you can simply use the built-in Sum command in the Calculate tab and then select Text37 and Text38 from the list...

Participant
February 12, 2019

I tried using both, but what happens is when I click “okay” after making the selections or entering the script, the box closes and the script or selections disappear as if I never entered anything in the first place…like this:

Thanks,

Janette