• Global community
• Language:
• Deutsch
• English
• EspaÃ±ol
• FranÃ§ais
• PortuguÃªs
• æ—¥æœ¬èªžã‚³ãƒŸãƒ¥ãƒ‹ãƒ†ã‚£
Dedicated community for Japanese speakers
• í•œêµ­ ì»¤ë®¤ë‹ˆí‹°
Dedicated community for Korean speakers
Exit
• Calculating totals for fields with and without rad...

# Calculating totals for fields with and without radio buttons

New Here ,
Mar 26, 2024 Mar 26, 2024

Copied

I have created a payment authorization form but am having trouble calculating totals. I attached a copy of the document for reference. Basically I have a box to enter amount then radio buttons to indicate service fees. One is ach and one is credit card fee. Lastly I have a total box. For the ach radio button I would like it to fill in \$4 when selected. For the credit card fee I would like it to calculate 3.5% of what is in the amount box. Then I would like the total to add the amount. And which ever value fills in from the radio buttons. How do I accomplish this??

TOPICS
How to

Views

59

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Community Expert ,
Mar 26, 2024 Mar 26, 2024

Copied

LATEST

As 'Custom calculation script' of "Total" field use this:

``````var rb = this.getField("Group1").valueAsString;
var amt = Number(this.getField("Amount2").valueAsString);
var ach = this.getField("ACH Fee");
var cc = this.getField("Credit Card Fee");
var achT = rb === "ACH" ? 4 : 0;
var ccT = rb === "Credit Card" ? (.035*amt) : 0;

ach.value = achT;
cc.value = ccT;
event.value = amt+achT+ccT;``````

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Resources