2 Replies Latest reply on Jun 21, 2013 9:12 AM by talon16

    Form Calc

    talon16

      I have some fields that total, I want the the field to show no more that 50 even if it is higher.  How do I write the if the totals of the 4 fields is greater that 49 then show 50 in this field?

        • 1. Re: Form Calc
          SaketSidana Adobe Employee

          Let's say you have got the value of total in a variable say numTotal. You want to display it in a field named numField1. You can write a formCalc or javascript to do that. Below is an example of how to do it through formCalc script:

           

          if (numTotal > 49) then

          form1.sf1.NumField1.rawValue = 50

          else

          form1.sf1.NumField1.rawValue = numTotal;

          endif

          1 person found this helpful
          • 2. Re: Form Calc
            talon16 Level 1

            Hi thanks for your response,  here is what I ended up with and works perfectly

             

            this = DropDownList1 + DropDownList2 + DropDownList3

             

            if (this>49) then

            this = 50

            else

            this = this

            endif

             

            Thanks again