Copy link to clipboard
Copied
Hi,
I have no clue how to do this, but I need help to calculate a total amount based on the number of checkboxes with an amount field that the client would input. See picture. Any help would be greatly appreciated.
For example, if client wanted to order time for a radio station for a certain amount that they would input, then it would show up in the total on the right. If they wanted to order time for more than one station, i need the amount to be multiplied by the number of checkboxes they choose. If that makes any sense.
Copy link to clipboard
Copied
Create the first text box and call it Subtotal. In form editing mode, right-click the box, select Create muliple copies and enter 5 down and 1 across. In the Total field, calculation tab, select Value is the Sum, then select the Subtotal field.
Copy link to clipboard
Copied
Make sure the check boxes have the same name, but with a different number at the end (example: Station1, Station2, Station3, Station4, Station5). Assuming the amount field is named "Amount", enter the following custom calculation script in the total field:
var cnt =0;
for(var i=1; i<6; i++)
{
if(this.getField("Station"+i).value!="Off")
{cnt++}
}
event.value=this.getField("Amount").value*cnt;
Copy link to clipboard
Copied
Thank you so much! It worked! I appreciate it!
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Create the first text box and call it Subtotal. In form editing mode, right-click the box, select Create muliple copies and enter 5 down and 1 across. In the Total field, calculation tab, select Value is the Sum, then select the Subtotal field.
Copy link to clipboard
Copied
Thanks! That worked, but I have a gut feeling the client will change something else and make it more complicated.
Copy link to clipboard
Copied
No changes! Thanks so much!