18 Replies Latest reply on Apr 27, 2016 11:10 AM by antragos

    If/then checkbox script help in Adobe Acrobat Form...

    dgraven

      If have an order form that has two different pricing fields (regular price per item & subscription price per item) for each line item and then a quantity and then a total field. Lastly, there is a checkbox on the form that indicate if they are signing up for a monthly subscription.

       

      What I am trying to do is create a script that totals each line by the regular price multipled by the quantity or subscription price by quantity if the subscription check box is checked ("Yes"). So far, I've tried several scripts I found in the forum but no luck at all.

       

      The check box is near the billing fields toward the bottom so all the line items appear first in the top section of the form. So, an individual would fill out each line and the calculations would just total each row (reg price * qty) as you go down the form...then when you check the subscription box all the line totals would change to reflect the subscription pricing for each row (which can be different). Just need help with one row and I can duplicate for each row.....

       

      Here is what I have that does NOT work yet.....:

       

       

       (function () {
      
      
      if (this.getField("sub").value==="Yes") {
           var b1 = this.getField("Price1b");
           var c1 = this.getField("Qty1");
           var d1 = this.getField("Price1");
           event.value = b1.value * c1.value;
      } else event.value = d1.value * c1.value;
          }
      
      
      )();