Conditional Equation based on checkbox
Hello, I would like to create a conditional equation in Acrobat.
Something like:
If check box # is checked, perform this equation: (Number in field A * number in field B) / 2
And if is not checked, don't divide by 2.
I've tried cobbling together some scripts from different questions to get it to work, but it's just not going for it and I don't know what I'm doing wrong. I've never used JavaScript before and it's not being specific enough to tell me what exactly the problem is. It seems like it doesn't like my else statement, but when I remove it just to get it to go through it acts like there's still an error there EVEN WHEN THERE IS NO LINE 7 ANYMORE.
Baby's first JavaScript is as follows:
// Relevant Field References
var TS = this.getField("Check Box5");
var OG = Number(this.getField("Text3").value);
var CP = Number(this.getField("Text13").value);
var PT = if TS.value = "On") event.value=OG*CP/2;
else event.value=OG*CP
