Copy link to clipboard
Copied
I have a field in which I need to sum the numbers in 2 other fields and the results of an optional radio button list. It worked fine when I used Acrobat's built in Value is the option to sum the 3. However, I want the filed to remain blank instead of displaying zero when the form is blank (so Luddites can print it and complete it by hand), so I switched to custom calculation. I got a result of "600off" when no radio button was checked. I tried the below script to substitute zero for "off" when no radio button is checked, but am getting a syntax error at the zero. I tried putting the zero in quotes to no avail. This form is my first foray into javascript and I clearly only know enough to be dangerous. Thanks in advance for any input.
event.value = this.getField("Total Fees").value + this.getField("Other Amnt").value + if(this.getField("Donation").value = ”off” {
0;
} else {
this.getField("Donation").value;
}
if (event.value == 0) {event.value = "";}
Have something to add?