1 Reply Latest reply on Jun 6, 2013 12:52 PM by gkaiseril

    If statement in PDF form

    MMorocco

      Problems getting an if statement to work under the custom calculation

       

      TOTAL HPI text field is counting the number for options selected for checkboxes hpi1-8

       

      I want the text field BRIEFHPI to display X if if the TOTAL HPI is >=3

      I want the text field EXTHPI to display X if the TOTAL HPI is >3

       

      I've tried various different ways - not working!  any help appreciated!!!!

        • 1. Re: If statement in PDF form
          gkaiseril MVP & Adobe Community Professional

          What ways?

           

          Do you know how to access objects in Acrobat JavaScript?

           

          // get TOTAL HPI field object's value as a variable;

          var TotalHPI = this.getField("TOTAL HPI").value;

          // reset or clear fields that could be adjusted in case they are not adjusted;

          this.resetForm(["BRIEFHPI", ]);

          // test the value of TotalHPi;

          if(TotalHPI >= 3) {

          // greater than or equal to 3;

          this.getField("BRIEFHPI").value = "X";

          }

          if(TotalHPI > 3) {

          // greater than  3;

          this.getField("EXTHPI").value = "X";

          }