Skip navigation
Currently Being Moderated

Help with custom calculation script and auto tab

May 25, 2012 2:52 PM

Tags: #custom #acrobat #script #calculation

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.

 
Replies
  • Currently Being Moderated
    May 26, 2012 6:44 AM   in reply to BeardedLady

    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

     
    |
    Mark as:
  • Currently Being Moderated
    May 26, 2012 7:49 AM   in reply to BeardedLady

    Look on the Options tab.

     

    Do not put numeric values within quotation marks or you will be comparing charter strings and not numeric values.

     

    You have to write a complex logical statement

     

    (event.value > 25 || event.value =< 75)

     
    |
    Mark as:
  • Currently Being Moderated
    May 26, 2012 11:26 AM   in reply to BeardedLady

    then I would use the choice as that is what the button will cause the value of the group of buttons to show as a value when selected?

     

    See the description on the tab.

     
    |
    Mark as:
  • Currently Being Moderated
    May 28, 2012 10:16 AM   in reply to BeardedLady

    See this Invoice.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 9, 2012 2:09 PM   in reply to BeardedLady

    It could be an error in the field calculation order.

     

    What happens as you continue to fillin fields?

     

    Can you post a link to the form?

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 9, 2012 5:14 PM   in reply to BeardedLady

    There are a number of free sites that allow one to share files online. I used www.acrobt.com for the Invoice form sample.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 10, 2012 8:08 AM   in reply to BeardedLady

    Without a sample form it is very difficult to see you very exact problem. The script provided can work with a drop down box in the custom keystroke but you would also have to have the drop down box also commit value immediately and the user would need to use the cursor keys for selecton.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points