1 Reply Latest reply on Jan 24, 2018 12:42 PM by gkaiseril

    Need JavaScript to Calculate Number of Checkboxes Minus 1

    adc501

      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?