Conditional statement not working
-
Hello,
I’ve been trying to get a calculated field to return a value based on the resulting value of another field. The code seems to work, but it’s ignoring the second statement and I’m lost as to why. Here is my setup:
I have a variable (fieldname82) that checks the value of two user entered textfields (a width and length field). The variable (fieldname82) checks the two user entered values and checks to see if one field is larger than the other – if the width field is larger, then it returns a value of ‘610W’ otherwise if the length field is larger, it returns ‘610L’
Next, I have a second variable (fieldname28) that checks whether the value of fieldname82 is ‘610W’, or ‘914W’ or ‘1118W’ and if it is, it returns one value, otherwise if the value of fieldname82 is ‘610L’, or ‘914L’ or ‘1118L’ then it returns something else. Here is the code:
(function(){ if(fieldname82 == '610L' || '914L' || '1118L') return fieldname29+100; else if(fieldname82 == '610W' || '914W' || '1118W') return fieldname30+100; })();The code works however it does not check the second line. It only just returns the result of the first line. Any help you can provide as to why would be very much appreciated!
The topic ‘Conditional statement not working’ is closed to new replies.