I have an order form with a ComboBox with various Canadian provinces called "ComboBox2". Each province has a different tax rate. (For example, ON is 8%, QC is 7.5%, NS is 15%)
I then have a subtotal Field named "Subtotal".
The last field is a taxes calculator Field named "Taxes".
What I want is for the "Taxes" field to change the rate depending on what province was chosen from "ComboBox2".
This is the code I have so far, which seems logical, but is not working:
var a = this.getField("Subtotal");
var b = this.getField("ComboBox2");
if (b = "QC" ) event.value = Math.round (a.value * 15) / 100;
if (b = "ON" ) event.value = Math.round (a.value * 8) / 100;
if (b = "AB" ) event.value = Math.round (a.value * 5) / 100;
Any suggestions?
EDIT: Using Acrobat 8 Pro, not Standard as indicated below.
if (b.value == "QC" ) event.value = Math.round (a.value * 15) / 100;
if (b.value == "ON" ) event.value = Math.round (a.value * 8) / 100;
if (b.value == "AB" ) event.value = Math.round (a.value * 5) / 100;
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com