Need JavaScript to Calculate Number of Checkboxes Minus 1

New Here ,
Jan 24, 2018 Jan 24, 2018

Copy link to clipboard

Copied

I have a fillable PDF form with five checkboxes named FEES3, FEES4, FEES5, FEES6, and FEES7. When any one of these five checkboxes is selected, a text field named Subtotal4 is automatically populated with a fee of $115. Each checkbox has the following JavaScript:

if (event.target.value=="Off") this.getField("Subtotal4").value = 0;

else this.getField("Subtotal4").value = 115;

After one checkbox is selected, every other checkbox should be $55, not $115. I have a second text field named Totalotherfees that I would like to populate with the number of additional checkboxes that were selected. So if one checkbox is selected, the Totalotherfees text field would remain empty. If 2 or more checkboxes are selected, the Totalotherfees text field would populate with the number of additional checkboxes selected.

Is there a script that I can add to the Totalotherfees text field to count the additional number of checkboxes selected? Or a script that will add the total number of checkboxes selected and subtract 1?

TOPICS
Acrobat SDK and JavaScript

Views

118

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 24, 2018 Jan 24, 2018

Copy link to clipboard

Copied

LATEST

This will require a Custom JavaScript action and the name of each field to be accessed needs to be provided.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines