3 Replies Latest reply on Oct 27, 2017 5:00 AM by try67

    Can a field name be changed with an incremented value based on a condition?

    ddunn@davidsdunn.com Level 1

      I want to replace "X" in

        var chk = this.getField("PX.myCheck.chkAmount")

      using an incremented value based on a condition.


      My objective is to add script to this example so that if(num2.value > "") then the field name "PX.myCheck.chkAmount" will become "P1.myCheck.chkAmount". 



      var num2 = this.getField("num.chk.02");

      var i = 0

      if(num2.value > "")(i = i + 1; var chk = this.getField("P1.myCheck.chkAmount";chk.value = num2.value);