I have put together a two page order form in Acrobat, based on an InDesign form exported as a PDF and populated it with fields for 30 items that can be ordered. Each item that can be ordered has a Color, Size, Quantity, Unit Price and Item Total (the last two are read only) field. For the Item Total, I have used "the value is the product of Quantity.x, Unit Price.x") calculation and for the SubTotal, "value is the sum of Item Total."
My first problem is that the subtotal field does not reflect the correct amount until I tab out of a Quantity field and enter data further down the order form. I would like for the date to be reflected in the subtotal as soon as it's entered. I have read of a custom keystroke script (auto tab the cursor to subsequent fields after form recipient types data in a field) that might take care of this problem, but a) I can't find the script and b) that would require Custom formatting for a field that needs to be Number formatted.
My second problem is coming up with a custom calculation script for the variable shipping rates, based on the subtotal:
up to $25 - $6; $25.01 - $75 = $11.50; $75.01.00 - $125.00 = $15.00
$125.01 - $200.00 =$20.00; $200.01- $300 = $25.00; $300.01 - $400 = $30.00
$401.01- $600 = $50
I would like to have two radio buttons, one to select Pickup (no fee) and the other to select Priority Mail shipping - the radio button that selects Priority Mail shipping will show the shipping amount in a separate text box, named shipping fee.
I also need a calculation that adds 5% to the SubTotal plus ShippingFee, if people are paying by credit card. I was hoping a simple field calculation would take care of that. (SubTotal + ShippingFee) * .05)
Any help or suggestions would be appreciated. If I need to upload the form, I can do that, although I need to know how to do that.
1. Check field calculation order. It sounds like it is not in the correct order.
2. I would use the switch statement and set the logical condition to true and specify the logical test as the label.
3. Make an exclusionary group for the check boxes, name field with same name but with different export values. When none of the fields within the group are selected then the value for the field is "Off".
4. Use the if statement to control the execution.
Conditional Execution by Thom Parker
The field calculation order was not in the correct order, had a devil of a time figuring out how to get to it, in Acrobat X.
My check boxes for shipping have the same name field but I don't see a tab for export value for the check boxes, and I have no idea how to implement your suggestions for a switch or if statement or what fields to attach them to.
My amatuer attempt at a shipping formula follows, I don't know if I can use a range for event value, or where to put the script, if it is even correct.
if(event.value == "<25.01")
{
nShipFee = 06;
}
else if(event.value == "25.01 - 75")
{
nShipFee = 11.50;
}
else if(event.value == "75.01 - 125")
{
nShipFee = 15;
}
else if(event.value == "125.01 - 200")
{
nShipFee = 20;
}
else if(event.value == "200.01 - 300")
{
nShipFee = 25;
}
else if(event.value == "300.01 - 400")
{
nShipFee = 30;
}
else if(event.value == ">400")
{
nShipFee = 50;
}
See this Invoice.
There are a number of free sites that allow one to share files online. I used www.acrobt.com for the Invoice form sample.
https://acrobat.com/#d=3G9QpqsUf-qvKBtDZJiPuw
I put in drop down boxes before I had your script for the shipping rates. When I first asked my questions, the field calculation order was not correct, which has since been sorted, although I still would like for the entered data to be reflected in the calculation without having to tab out of the field.
North America
Europe, Middle East and Africa
Asia Pacific