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

Calculations don't work anymore after editing with LiveCycle

lisamwise
Registered: May 18 2009
Posts: 22

I have a product order form that I started to work with in Word then converted to pdf and used Acrobat 8's form recognition to finish. I tweeked the form to calculate totals, including sales tax only if the order was from someone in our state. In order to be more pci compliant, I decided to convert the credit card number to a bar code, but in order for our Point of Sale scanners to read it, it had to be a special kind of bar code that wasn't built into Acrobat, so on to LiveCycle. When I converted to LiveCycle most my simple calculations worked (qty * unit_price = total_price), but one other didn't and the sales tax one was commented out. I did get a notice when I converted it about some of the javasript needing to be updated... but I have no clue how to update it. The strange thing is that one of my simple calculations doesn't work and wasn't commented out. It takes the value of an item in a check list (i.e. the cost of shipping types) and puts the price in the form. The checklist works fine, but the calculation doesn't ever show up.

Here's the code I have for the sales tax calculation that worked in Acrobat (Thanks to gkaiseril for the help with this!):

var state = this.getField("State").value.toLowerCase();
var subt = this.getField("Subtotal").value;
var rate = subt * .07;
if (state == "ia") event.value = rate;
else event.value = 0;

This is the code that LiveCycle converted for the Shipping field that is supposed to update based on the shipping type selected from a check list:  this.rawValue = Shipping_type.rawValue;
I need to present this form to co-workers tomorrow morning and would love to have the whole thing working by then! Any help is much appreciated!

My Product Information:
LiveCycle Designer, Windows
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
Acrobat AcroForms and LiveCycle Designer are 2 different form products. You should not switch a form between the products. If you go from an AcroForm to LiveCycle Desinger, the JavaScirpts will be commented out and you will have to change part to be compatible to LiveCycle Desinger's JSO.

George Kaiser

lisamwise
Registered: May 18 2009
Posts: 22
I couldn't help it. Acrobat didn't have the type of barcode that I needed for our systems to be able scan it. I guess I could try starting from scratch in LiveCycle, but then I have the same problem - I don't know what the script should be to calculate the sales tax. I really don't know a whole lot about javascript; I guess that's where the real problem lies. :)
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
For FormCalc:
if (Lower(State) == 'ia' )  thenSubTotal * 0.07else0endif

George Kaiser

lisamwise
Registered: May 18 2009
Posts: 22
Thank you again for all your help George! I got the entire form working now. I did have to make one change to your code, though. Had to replace the the single quotes with doubles. Kept getting a scripting error, but now it works great! Thanks again!