Skip to main content
Inspiring
June 23, 2022
Question

Acrobat forms if radio buttons and checkboxes checked

  • June 23, 2022
  • 1 reply
  • 6304 views

Hi everybody,

I'm trying to create an acrobat form for the first time with some JS code. I'm trying since two days now, but somehow cannot figure out how to check if radio buttons and checkboxes are checked and then do a specific calculation.

The form looks like this. In the last field should come a calculation with the values of the fields above. So for example if radio option 2 and first checkbox are check the total value is 60, so in the bottom field has to be "9" (15% of 60).

 

Hope somebody here can help me out with this.

 

Appreciate any help or advice you could give.

 

Thanks a lot in advance!

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
June 23, 2022

You actually don't need a script. If you've applied those values as the export values of the fields then you can use this formula under the Simplified Field Notation option of the last field (you didn't specify the field names, so let's say they are Radio1, CheckBox1 and CheckBox2:

 

(Radio1 + CheckBox1 + CheckBox2) * 0.15

Rostam777Author
Inspiring
June 23, 2022

Thanks a lot for your quick reply! Sounds really interesting, but where can I set the export value?

try67
Community Expert
Community Expert
June 24, 2022

In the next step I need a new field to sum up all selected field values, like in this example:

So the checkbox of the 15% field does not have a fixed export value. It can change depending what is selected before. How can I achieve that calculation? Thanks a lot!!


OK, I see. You can make it work if you set the export value of the check-box to 1 and then multiply it by the value of the text field that shows the 15% value. For example:

 

Radio1 + CheckBox1 + CheckBox2 + (Text15Percent * CheckBox2)