Hello, I only know the basics of Java coding so I am not very good.
I have a document I am working with that has cuustom form fields.
I need help writing a script that says. If “choice1” is checked then it will discount 5% from the “Grand Total” field. And if “choice2” is checked then the “Grand Total” field will stay the same.
I am using radial buttons.
the “Grand Total” field is calculating the sum of multiple fields also.
so essentially if a customer wants to click yes to pickup they get a 5% discount from their total.
They have specific APIs. I would suggest you read the “Acrobat JavaScript Developer Guide” (Chapter 6 Using JavaScript in Forms) from the Acrobat SDK 2021 page.
The Developer Guide pdf has some examples like “Calculating the average of several text fields”. In the loop example, you would likely need to check the isBoxChecked property of the checkboxes to skip or include the specific inputs.
I don’t have Acrobat installed so I can’t really test anything but it looks a lot like the browser web APIs.