1 Reply Latest reply on Nov 5, 2015 7:56 AM by try67

    calculate total based on filled text fields

    omanbux Level 1

      Hi, i have 5 fillable text fields in my form. first 4 fields are normal text filling fields & 5th one is total field. each field value is $15. what i want to do is if first field  filled with any text then total field value is $15. if second text fields filled then total field value $30. like that it should calculate all 4 fields total. pls help me to manage this. thanks..

        • 1. Re: calculate total based on filled text fields
          try67 MVP & Adobe Community Professional

          You can use something like this as the custom calculation script of the total field (just adjust the fields names, of course):

           

          var total = 0;
          if (this.getField("Text1").valueAsString!="") total+=15;
          if (this.getField("Text2").valueAsString!="") total+=15;
          if (this.getField("Text3").valueAsString!="") total+=15;
          if (this.getField("Text4").valueAsString!="") total+=15;
          event.value = total;