I have tried a number of approaches to a calculation but keep getting NaN.
I have fields A that is a value in inches,B is a value in mm, C is a value in cm.
The user of the form only needs to fill out one of the fields and the other 2 will populate based on a calculation.
So, for example, if they fill in A, it will keep that value in A, but B and C will auto populate.
If they change any one of the values, the other fields will update.
Below is the most recent code which I added as a calculation for field A. It returned NaN.
Thanks for any help!
var A = this.getField("A").valueAsString;
var B = this.getField("B").valueAsString;
var C = this.getField("C").valueAsString;
if (A=="" && B=="")
event.value = C.valueAsString / 2.54;
else if (A=="" && C=="")
event.value = B.valueAsString / 25.4;
event.value = event.target.value;
It seems like it would make more sense to check B for a value and calculate if it has one, check c for a value and calculate if it has one, or do nothing (display what is entered). But I could not figure that out either.