2 Replies Latest reply on Feb 10, 2009 3:08 PM by hattg

    JavaScript help

      I have very little scripting knowledge, which doesn't help. I am very close, but it's not quite doing what I want. What I need is if the value of v1 is 9 or less, then I need it to multiply by v3 and give me a total. If it is more than 9, I need it to multiply by v2 and give me a total.

      Thanks in advance.

      Here is my script:

      // Cost if 1-9
      var v1 = this.getField("1-9_ADS");

      // Cost if 10+
      var v2 = this.getField("10+_ADS");

      // Quantity
      var v3 = this.getField("Quantity_ADS");

      if (v1 <= 9)
      event.value = v1.value * v3.value;
      } else
      event.value = v2.value * v3.value;