2 Replies Latest reply on Jul 17, 2017 6:22 AM by maryanna28157751

    Have two separate fields with script that I want as one

    maryanna28157751 Level 1

      Hello, I'm new to JavaScript for Adobe forms I'm not sure of all the coding or proper terminology. So far I've been doing alright searching the forums for answers, but I can't seem to get this one right.

       

      I have two separate fields with script in them that when the boxes are checked it calculates the savings for the customer. One is for how much they would have saved if they where members and the other is how much they are saving because they are members. It's 20% difference for members and none members.

       

      I would like to put all of the script into one field to run the calculations. When I try to combine them only one check box will work the other doesn't.

       

      The two fields and scripts are

      SmileyClubSavings

      if (this.getField("RepairFee").isBoxChecked(0)=="1"){event.value=this.getField("Price").valu e*0.2;} else event.value = 0;

       

      Subtract

      if (this.getField("SmileyClubDiscount").isBoxChecked(0)=="1"){event.value=this.getField("Smi leyClub").value-this.getField("Price").value;} else event.value = 0;

       

      Working with Adobe Acrobat Pro DC