Calculations based on radio button values
Copy link to clipboard
Copied
Two quick questions if I may... please see a screenshot below of my Acrobat form...
Question 1
I have created a basic Java Script calculation to sum the value of the quantities under the "food section" (i.e. (Refreshments*2)+(Food_1*6.5)+(Food_2*10)+(Food_3*3)).
But would like to add £30 to the total field ("TOTAL") if the half day radio button ("Half_Day") is selected, or £50 of the full day button is selected (Full_Day")
Question 2
Presumably the 25% deposit field would be calculated by stating that it equals TOTAL*0.25?
Thanks in advance
Simon
Copy link to clipboard
Copied
1. You would need to use custom calculation script, also is quantity supposed to be calculated only if corresponding radio button is checked? Are those radio buttons belong to same group?
2.Yes.
Can you share your file?
Copy link to clipboard
Copied
You'll find the articles here very useful. Be sure to read the "Entering Calculation" Scripts article, especially the part on calculation order.
https://www.pdfscripting.com/public/Calculating-field-values-and-more.cfm
An "if" statement will be needed in the custom calculation to provided the requested fuctionality. To help you with this we'll need to know the name of the radio button field and it's export values. You can read about the basics of scripting radio buttons here:
https://www.pdfscripting.com/public/Checkboxes-and-Radio-Buttons.cfm
Use the Acrobat JavaScript Reference early and often

