Question
'If' statement on form syntax error
Hi guys,
I'm trying to write code for an 'if' statement on a form but I'm getting a syntax error and can't work out why. It's saying the error is on line 2... I'm new to this! Please help.
Basically I need the average of variable A and variable B calculating, but only if variable B is greater than variable A. If variable B is greater than variable A, use B. This is the code:
var A = this.getField("<Actual>").value + var B = this.getField("<Google Maps>").value /2;
if( B > A ) event.value = B;
else event.value = this.getField("<Value>").value;