10 Replies Latest reply on Feb 21, 2018 2:17 PM by keviny45

    Trying to write a Javascript to compare the lesser amount of two fields (p2 & p3) to perfom a calculation that divides the lesser of the two fields by a 3rd field (p1) that will display the results in the field I'm writing the script. Below doesnt work

    keviny45 Level 1

      var x = this.getField("p2").value;
      var y = this.getField("p3").value;

      if (p2 < p3) {
          event.value = "p1 / p2";
      }
      else {
          event.value = (p1 / p3).toFixed(2);;
      }