Answered
I have a form where I would like to automatically calculate the sales tax on the subtotal based on if the billing state entered is Iowa. I have tried a few simple if statements in the custom calculation scripts section, but none have worked.
Here's one I have tried:
var state = this.getField("B_state").value; var subt = this.getField("Subtotal").value; var rate = subt * .07; if (state == "ia") event.value = rate; else event.value = 0;
Can anyone help me with this? I am a total javascript newbie and got the examples above from reading other threads on this forum. Thanks!
Are you creating the form in Acrobat or LiveCycle Designer?
What are the possible export values for the "B_state" field?
For a field that holds the sales tax rate, and the export values for the 'B_stae' field are the standard U.S. Postal 2 letter state values:
Once you get the sales tax rate field to work, you can then compute the sales tax amount and total of the sales tax and subtotal.
George Kaiser