Two if statements/ignore other conditions if variable value = 1
https://community.adobe.com/questions-9/conditional-equation-based-on-checkbox-1300826
So, my script has an issue where it'll do this formula even if the originals value is 1. Now, people shouldn't be putting 1 original and checking double-sided, but they are, and it's bothering me that the script is halving it when it shouldn't. I was thinking I want something like if var OG = 1, event.value = OG * CP, but putting that seems to screw up the rest of the formula. So then I was thinking, is it possible to have two if statements before the result so that I can make the other statements conditional on OG being more than 1, but I can't seem to find the right syntax for that either.
As it stands my formula is like this:
// Relevant Field References
var TS = this.getField("Check Box5").valueAsString;
var OTS = this.getField("Check Box1").valueAsString;
var OG = Number(this.getField("Text3").valueAsString);
var CP = Number(this.getField("Text13").valueAsString);
if(OTS !== "Off")
event.value = Math.ceil(OG*CP/2);
else
if(TS !== "Off")
event.value = Math.ceil(OG*CP/2);
else
event.value = OG*CP;
I'm open to other solutions if my idea how to fix it is too convoluted.
