3 Replies Latest reply on Oct 7, 2015 1:16 PM by George_Johnson

    javascript noob question inside acrobat

    mjleavitt01236541 Level 1

      I'll preface this with I'm not a regular user of javascript, so forgive any ignorance. Onto my question.

       

      I have a custom calculation script inside a PDF textbox (named PgoalRow2)

       

      (function () {
          var v1 = +getField("UPDRow2").value;
          var v2 = +getField("UPARow2").value;
          event.value = v2 !== 0 ? v2 / v1 : "";
      })();
      

       

      I'd like to find some way to write the above function to return the "2" from the end of PgoalRow*whatever* and append it onto the end of UPDRow*whatever* and UPARow*whatever*

       

      I hope that makes sense.

       

      I was trying to find a way to write a single function without having to manually change each getField twice per textbox. Each textbox is named sequentially as PgoalRow2, PgoalRow3, etc

       

      thanks in advance.