Skip to main content
New Participant
February 12, 2019
Answered

calculate subtotal fields

  • February 12, 2019
  • 1 reply
  • 1549 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
February 12, 2019

Use this:

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

try67
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...

New Participant
February 12, 2019

You can't use both. Either one or the other.

And if you tried attaching a screenshot it didn't come through. Reply directly from the forum and use the Insert Image icon. Don't attach the image to an email.


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!