These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

FormCalc -- simple multiplication

sajara
Registered: Oct 6 2007
Posts: 14

I'm struggling with something that is probably very simple, but I have never done it before and my searches in LiveCycle help have been futile so I would greatly appreciate some assistance.

I am creating a mileage reimbursement form in LiveCycle 8.0, and I have a column for entering the number of miles, and then a column that I want to display the amount due, which would be the number of miles times $0.485. I currently have the amount-due column set up as a numeric field. I cannot find where I'm supposed to enter any formcalc language (and I wouldn't know what to put there even if I could find it).

My default language is formcalc. I have searched through help and through these forum archives, but I can't seem to find an answer. If someone wouldn't mind walking me through this, I'd be very grateful.

The first two steps in the help instructions are:

1. Select an object on your form design that supports events.

2. In the Script Editor, from the Show list, select one of the events that apply to the object. The event you choose specifies when the script will execute. If you are writing a calculation or script that affects an object that does not support events, you must add your calculation or script to a form design object that does support form events.

If I can just find the "Show list," perhaps I can start figuring the rest out. I'm selecting the object (the numeric field), but I don't see a "show list." Maybe this object does not support events? I'm lost.

Thank you!

My Product Information:
LiveCycle Designer, Windows
scottsheck
Registered: May 3 2007
Posts: 138
Sajara,

The 'Show List' is at the top left. On the screen, it actually just says 'Show:' with a drop down list to the right of it.

If you don't even see 'show:', then you have to first turn on the script editor, by choosing the menu Window, then Script Editor.

Good luck!

Scott
DominicanPete
Registered: Jan 4 2008
Posts: 41
Scott is correct - you must open the script editor before you can add any script to a control. Do the following:
1 - select 'Window' on the menu bar
2 - select 'Script Editor'

This will display a single line editor that has the 'Show:', an entry field, 'Language' and some other info. Use the grabber bar and pull it down to get more space for entry.

If you want to calculate the mileage amount when the user exits your mileage field, drop down the 'Show:' combo box and select the 'exit' event. Type in your formula for the calculation, and you should be good to go. If you are putting the results into a different field, then you will need something like this for formcalc code:

nfAmountOwed.rawValue = nfMileage.rawValue * .0485

Format the fields appropriately, and you should be good.