Need help with calculating a value based on the status of a checkbox
I'm trying to create a script to provide a value in a text box based on a checkbox and two other text boxes. I've been jumping between a lot of sites trying to figure it out, but no luck.
I'm using the current version of Acrobat Pro.
If the checkbox is unchecked, I want to pull the value from "Text Box_1".
If the checkbox is checked, I want to total the values from "Text Box_1" & "Text Box_2".
The results will show in "Text Box_3".
Here is what I have, but it doesn't work. Not sure where I'm going wrong.
The checkbox output is the default "Yes".
Text Box_1 & 2 will have a value of something like this: "+1" & "+3", respectively.
The result in Text Box_3 would be either "+1" or "+4" depending on the state of the checkbox.
event.value=0;
if(this.getField("Check Box_1").value!="Off") event.value=this.getField("Text Box_1").value;
else if(this.getField("Check Box_1").value!="Yes") event.value=(this.getField("Text Box_1").value + this.getField("Text Box_2").value);
Any help would be greatly appreciated.
