Skip to main content
Participating Frequently
April 17, 2019
Question

Validating Two Numbers with Javascript

  • April 17, 2019
  • 1 reply
  • 1032 views

Hello guys, I am really rookie with Javascript but I'd like to know what is wrong with this code?

I get alerted but not exactly on the numbers. I have two TOTAL values that I compare and I want to be alerted if they're the same or different.
Can anyone take a look and perfect this code, will be appreciated.

var V1=Number(this.getField("A").value);

var V2=Number(this.getField("B").value);

if(V1==V2)

{

app.alert("EQUAL");

}

else if (V1 >> V2){

app.alert("First value is bigger");

}

else {

app.alert("First value is smaller");

}

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
April 17, 2019

Replace ">>" with ">".

Participating Frequently
April 17, 2019

Nope, same outcome.

try67
Community Expert
Community Expert
April 17, 2019

What is the outcome, exactly, and where did you place the code?