Im attempting to create a Javascript range calculator for a "trade in value of a car" this is a small part of a huge project im working on, i have the finished version in an excel file but decided to remake in adobe acrobat pro using Javascript, the purpose is to adjust the value of a number if it falls between the ranges below, if someone can point me in the right direction to get this code to work, id really appreciate it!
In plain text below,
Trade Value X 2.00 If Less Than 5999.00;
Trade Value X 1.75 If Greater Than 5999.00 But Less Then 9000.00;
Trade Value X 1.50 if Greater Than 9000.00 But less Than 11,000.00;
Trade Value X 1.40 if Greater Than 11,000.00 But less Than 12,000.00;
Trade Value X 1.35 if Greater Than 12,000.00 But less Than 13,000.00;
Trade Value X 1.30 if Greater Than 13,000.00 But less Than 14,000.00;
Trade Value X 1.25 if Greater Than 14,000.00 But less Than 17,000.00;
Trade Value X 1.20 if Greater Than 17,000.00 But less Than 20,000.00;
Trade Value X 1.15 if Greater Than 20,000.00 But less Than 24,000.00;
Trade Value X 1.10 if Greater Than 24,000.00;
Should = “Amount Financed” Field In Adobe
The code im attempting to implement:
var VTV = Number(this.getField("VehicleTradeValue").valueAsString);
var AMF = Number(this.getField("AmountFinanced").valueAsString);
((VehicleTradeValue)*2.00) If (VehicleTradeValue) < 5999.00;
elif:
((VehicleTradeValue)*1.75) If (VehicleTradeValue) < 5999.00 < 9000.00;
elif:
((VehicleTradeValue)*1.50) if (VehicleTradeValue) > 9000.00 < 11,000.00;
elif:
((VehicleTradeValue)*1.40) if (VehicleTradeValue) > 11,000.00 < 12,000.00;
elif:
((VehicleTradeValue)*1.35) if (VehicleTradeValue) > 12,000.00 < 13,000.00;
elif:
((VehicleTradeValue)*1.30) if (VehicleTradeValue) > 13,000.00 < 14,000.00;
elif:
((VehicleTradeValue)*1.25) if (VehicleTradeValue) > 14,000.00 < 17,000.00;
elif:
((VehicleTradeValue)*1.20) if (VehicleTradeValue) > 17,000.00 < 20,000.00;
elif:
((VehicleTradeValue)*1.15) if (VehicleTradeValue) > 20,000.00 < 24,000.00;
else:
((VehicleTradeValue)*1.10) if (VehicleTradeValue) > 24,000.00;
event.value = self;
Aucun commentaire:
Enregistrer un commentaire