Skip to main content
Participant
May 2, 2019 7:00 PM UTC
Question

calculating checkboxes (not fields) in Adobe Acrobat XI Pro

Can someone please help me?  I need to know how to calculate checkboxes (not fields), when two or more checkboxes have been chosen in Adobe XI Pro.  I'm totally lost.

This is what I have so far, but I can’t get them to calculate.

event.value=0

if (this.getField("CheckBox1").value!="Off")event.value=95; if (this.getField("CheckBox2").value!="Off")event.value=200; if (this.getField("CheckBox3").value!="Off")event.value=525; if (this.getField("CheckBox4").value!="Off")event.value=647; if (this.getField("CheckBox5").value!="Off")event.value=617; if (this.getField("CheckBox6").value!="Off")event.value=800; if (this.getField("CheckBox7").value!="Off")event.value=65; if (this.getField("CheckBox8").value!="Off")event.value=65; if (this.getField("CheckBox9").value!="Off")event.value=65; if (this.getField("CheckBox10").value!="Off")event.value=95; if (this.getField("CheckBox11").value!="Off")event.value=148; if (this.getField("CheckBox12").value!="Off")event.value=525; if (this.getField("CheckBox13").value!="Off")event.value=560; if (this.getField("CheckBox14").value!="Off")event.value=800; if (this.getField("CheckBox15").value!="Off")event.value=65; if (this.getField("CheckBox16").value!="Off")event.value=65; if (this.getField("CheckBox17").value!="Off")event.value=105; if (this.getField("CheckBox18").value!="Off")event.value=95; if (this.getField("CheckBox19").value!="Off")event.value=65; if (this.getField("CheckBox20").value!="Off")event.value=525; if (this.getField("CheckBox21").value!="Off")event.value=572; if (this.getField("CheckBox22").value!="Off")event.value=1,000; if (this.getField("CheckBox23").value!="Off")event.value=65; if (this.getField("CheckBox24").value!="Off")event.value=65; if (this.getField("CheckBox25").value!="Off")event.value=105; if (this.getField("CheckBox26").value!="Off")event.value=95; if (this.getField("CheckBox27").value!="Off")event.value=65; if (this.getField("CheckBox28").value!="Off")event.value=525; if (this.getField("CheckBox29").value!="Off")event.value=1,200; if (this.getField("CheckBox30").value!="Off")event.value=65; if (this.getField("CheckBox31").value!="Off")event.value=65; if (this.getField("CheckBox32").value!="Off")event.value=105; if (this.getField("CheckBox33").value!="Off")event.value=150; if (this.getField("CheckBox34").value!="Off")event.value=180; if (this.getField("CheckBox35").value!="Off")event.value=180;

I don’t know what to use here.

newTotal=(this.getField("CheckBox1")e.value+this.getField("CheckBox2")e.value;

  1. event.value=newTotal);

[ moved from Forum comments to JavaScript by moderator ]

This topic is closed to new replies. Start a new post to keep the conversation going.

8 replies

JR Boulay
Community Expert
Community Expert
May 5, 2019 8:35 AM UTC

You should use checkboxes export value and the field naming convention, so things will be easier and most of calculations can be made without using JavaScript.

You can download a free sample PDF here: www.abracadabrapdf.net/parking/AcroUsers/calcul-addition-checkbox.pdf

Translate
Acrobate du PDF, InDesigner et Photoshopographe
jdgreenAuthor
Participant
May 2, 2019 8:52 PM UTC

I mean that I want the checkboxes to mathematically tally i.e. CheckBox1 value $95 + CheckBox2 value $200 = $295.

Translate
try67
Community Expert
Community Expert
May 2, 2019 9:01 PM UTC

Apply the value (without the dollar symbol!) as the export value of each field and you'll be able to use the built-in Sum function under the Calculate tab to do it, without using any scripts.

Translate
jdgreenAuthor
Participant
May 2, 2019 9:17 PM UTC

Here's a sample.

Translate
try67
Community Expert
Community Expert
May 2, 2019 7:14 PM UTC

What do you mean by "calculate checkboxes", exactly? Do you mean tick or un-tick a check-box based on the value of other check-box fields?

Translate