Skip to main content
Participating Frequently
April 17, 2019
質問

Validating Two Numbers with Javascript

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");

}

このトピックへの返信は締め切られました。

返信数 11

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?