I have a simple calculation that i need to write as a JS in adobe Acrobat 9 professional. There are two varianbles. One is from a radial button (selected only if a condition exists otherwise it remains unselected). If the button is selected the export value is "yes". The other variable is user input (a quantity). When the quantity is input one of five things will happen.
1. if the quantity is >= 50 and <100 and the other variable is not selected, then the result is the quantity times 25.
2. if the quantity is >=100 and the other variable is not selected, then the result is the quantity times 21.70.
3. if the quantity is >= 50 and <100 and the other variable is selected, then the result is the quantity times 25 + 80.
4. if the quantity is >=100 and the other variable is not selected, then the result is the quantity times 21.70 + 80.
5. there is a separate script that prevents a quantity less than 50 from being selected.
Below is the script i created. i'm new to java so please let me know what to fix
event.value = 0
var setup = this.getField(“yes”).exportvalue + var quantity = this.getField("ValetTrayQty").value;
if(quantity >= 50 && quantity < 100 & setup = null)
event.value = quantity * 25.00;
else if (quantity >= 100; && setup = null)
event.value = quantity * 21.70;
if(quantity >= 50 && quantity < 100 & setup = yes)
event.value = quantity * 25.00 + 80;
else if (quantity >= 100; && setup = yes)
event.value = quantity * 21.70 + 80;