2 Replies Latest reply on Apr 24, 2015 1:48 PM by gkaiseril

    Help with javascrip

    sandras85595954

      Hello,

       

      I am unfortunately not well-versed in javascript, & I have the following formulas in Excel that I need to put in a custom calculation script for a cell in an Adobe form.  Would anyone be able to help me with these?

       

      =IF(ISNUMBER(E27),(C27+(E27*C20))," ")

      =IF(ISBLANK(K27)," ",C27)

      =IF(K28>L28,"Out Tol","In Tol")

      =IF(I15>10000,(L2)*2,L2)

        • 1. Re: Help with javascrip
          sandras85595954 Level 1

          Or even direct me somewhere where I could learn this type of syntax?

          • 2. Re: Help with javascrip
            gkaiseril MVP & Adobe Community Professional


            I would start with JavaScript for Acrobat and JavaScript MDN and some of the tutorials posted by Adobe for Acrobat.

             

            Since Acrobat forms to not have cells like Excel, you will need to use field names and variables.

             

            =IF(ISNUMBER(E27),(C27+(E27*C20))," ")

             

            Could have a custom JavaScript for the result field:

             

            if( !isNaN(Number(this.getField("E27").value) {

            event.value = "";

            } else {

            event.value = this.getField("C27").value + (this.getField("E27").value * this.getField("C2)").value);

            }

             

            =IF(ISBLANK(K27)," ",C27)

             

            if(this.getField("K27").valueAsString == "") {

            event.vallue = "";

            } else {

            event.value = this.getField("C27").value;

            }

             

            =IF(K28>L28,"Out Tol","In Tol")

             

            if(this.getField("K28").value >if(this.getField("L28").value)  {

            event.value = "Out Tol";

            } else {

            event.value = "In Tol";

            }

             

             

            =IF(I15>10000,(L2)*2,L2)

             

            if(this.getField("I15").value >10000)  {

            event.value = this.getField("L2").value * 2;

            } else {

            event.value = this.getField("L2").value;

            }