Copy link to clipboard
Copied
I have 3 radio button options to chose from, but I only want one certain one to calculate a sales tax. How can I assign a calculation to one radio button?
OK. Let's say the name of the radio-button group is "Radio1", the export value of that field is "3", the name of the sub-total is "SubTotal" and the tax rate is 16%. You can use this code as the custom calculation script of the Tax field:
event.value = (this.getField("Radio1").valueAsString=="3") ? Number(this.getField("SubTotal").valueAsString) * 0.16 : 0;
Copy link to clipboard
Copied
Can you describe the full situation, please? Do you mean that you have something like a sub-total and a tax field, and the tax field should only be populated if that specific button is selected? Should it be zero otherwise?
Copy link to clipboard
Copied
That is exactly correct.
Copy link to clipboard
Copied
OK. Let's say the name of the radio-button group is "Radio1", the export value of that field is "3", the name of the sub-total is "SubTotal" and the tax rate is 16%. You can use this code as the custom calculation script of the Tax field:
event.value = (this.getField("Radio1").valueAsString=="3") ? Number(this.getField("SubTotal").valueAsString) * 0.16 : 0;
Copy link to clipboard
Copied
Where do I find the "Export Value Field".... I don't see it under properties?
Copy link to clipboard
Copied
Sorry, it got renamed to "Radio Button Choice". It's under Properties - Options.
Copy link to clipboard
Copied
Thank you SO MUCH...That worked perfect!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now