17 Replies Latest reply on Oct 3, 2014 3:04 PM by try67

    Comparison Statement

    wayne rierson

      I have a form I want to compare two fields. One field is the results of a test that was performed. The other field is the specified requirement that the test should have met. Field one is called "fr1". Field two is called "sr1". I want a third field "dd1", (the one which will hold the code) to compare the two other fields and if fr1 <sr1 then dd1 should said "Fail, and if it is >sr1 then it should say "pass". I think I am close but I keep getting a syntax error.



      var nValue = Number(this.getField("fr1").value);


      var mValue = Number(this.getField("sr1").value);


      if(nValue < mValue) { event.value =”Fail”;} else {event.value = “Pass”;}



      The error message is "SyntaxError: Illegal character

      3: at line 4.


      can someone help me with this one please?