Acrobat Field value not selecting value from multiple conditional statements

Explorer ,
Feb 19, 2021 Feb 19, 2021

Copy link to clipboard

Copied

I have a text field named Tilte fees that I have put the following Custom Calculation Script in hopes of getting the appropiate value from the list of conditions but not working- I am new so I haven't worked my way up to Switches or Arrays- is what I'm trying to accomplish possible with using only if/else conditional statements?

here's what I have:

 

var TTT = this.getField("Transaction_Type").value;
var cbLien = this.getField("Lien1_Fee").value;
var cbLienASS = this.getField("Lien1ASS_Fee").value;
var cbFL = this.getField("CheckBox_Florida").value;
var cbETIT = this.getField("CheckBox_Electronic_Title").value;
var cbPTIT = this.getField("CheckBox_Paper_Title").value;
var cbFTIT = this.getField("Fast_Title").value;
var cbHire = this.getField("CheckBox_ForHire").value;
var VEHTYPE = this.getField("Vehicle_Type").value;
var BTA = this.getField("BodyAuto").value;
var BTTR = this.getField("BodyTruck").value;
var BTMC = this.getField("BodyMotorCycle").value;
var BTOH = this.getField("BodyOffHighway").value;
var BTTO = this.getField("BodyTools").value;
var BTVT = this.getField("BodyVehicleTrailer").value;
var BTVS = this.getField("BodyVessel").value;
var BTBS = this.getField("BodyBus").value;
var BTTT = this.getField("BodyTravelTrailer").value;
var BTAM = this.getField("BodyAmphibian").value;
var BTMH = this.getField("BodyMobileHome").value;
var CC = this.getField("Class_Codes").value
var cbOHTD = this.getField("OHV_Title_Decal").value;

 

if (TTT === "ONT" && VEHTYPE !== "MH" && (BTA !== "PC" || "MH") && cbHire === "Off" && cbLien === "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 77.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 79.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off"){event.value = 87.25;}

if (TTT === "ONT" && VEHTYPE !== "MH" && (BTA !== "PC" || "MH") && cbHire === "Off" && cbLien !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 79.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 81.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off"){event.value = 89.25;}

if (TTT === "ONT" && VEHTYPE !== "MH" && (BTA !== "PC" || "MH") && cbHire !== "Off" && cbLien === "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 56.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 58.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off"){event.value = 66.25;}

if (TTT === "ONT" && VEHTYPE !== "MH" && (BTA !== "PC" || "MH") && cbHire !== "Off" && cbLien !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 58.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 60.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off"){event.value = 68.25;}

if (TTT === "ONT" && VEHTYPE === "MH" && cbHire === "Off" && cbLien === "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 76.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 78.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 86.25;}

if (TTT === "ONT" && VEHTYPE === "MH" && cbHire === "Off" && cbLien !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 78.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 80.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 88.25;}

if (TTT === "ONT" && VEHTYPE === "AU" && (BTA === "PC" || "MH") && cbHire === "Off" && cbLien === "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 78.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 80.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 88.25;}

if (TTT === "ONT" && VEHTYPE === "AU" && (BTA === "PC" || "MH") && cbHire === "Off" && cbLien !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 78.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 80.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 88.25;}

if (TTT === "ONT" && VEHTYPE === "AU" && (BTA === "PC" || "MH") && cbHire !== "Off" && cbLien === "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 57.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 59.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 67.25;}

if (TTT === "ONT" && VEHTYPE === "AU" && (BTA === "PC" || "MH") && cbHire !== "Off" && cbLien !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 59.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 61.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 69.25;}

if (TTT === "ONT" && VEHTYPE === "TR" && BTTR === "MC" && cbHire ==="Off" && cbLien === "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 78.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 80.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 88.25;}

if (TTT === "ONT" && VEHTYPE === "TR" && BTTR === "MC" && cbHire ==="Off" && cbLien !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 80.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 82.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 90.25;}

if (TTT === "ONT" && VEHTYPE === "TR" && BTTR === "MC" && cbHire !=="Off" && cbLien === "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 78.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 80.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 88.25;}

if (TTT === "ONT" && VEHTYPE === "TR" && BTTR === "MC" && cbHire !=="Off" && cbLien !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 80.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 82.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 90.25;}

if (TTT === "OUT" && cbHire ==="Off" && cbLien === "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 85.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 87.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 95.25;}

if (TTT === "OUT" && cbHire ==="Off" && cbLien !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 85.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 87.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 95.25;}

if (TTT === "OUT" && cbHire !=="Off" && cbLien === "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 64.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 66.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 74.25;}
if (TTT === "OUT" && cbHire !=="Off" && cbLien !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 66.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 68.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 76.25;}

if (TTT === "TRT" && cbHire ==="Off" && cbLien === "Off" && cbFL !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 75.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 77.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 85.25;}

if (TTT === "TRT" && cbHire ==="Off" && cbLien !== "Off" && cbFL !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 77.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 79.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 87.25;}

if (TTT === "TRT" && cbHire !=="Off" && cbLien === "Off" && cbFL !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 54.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 56.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 64.25;}

if (TTT === "TRT" && cbHire ==="Off" && cbLien !== "Off" && cbFL !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 56.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 58.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 66.25;}

if (TTT === "TRT" && cbHire ==="Off" && cbLienASS !== "Off" && cbFL !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 78.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 80.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 88.25;}

if (TTT === "TRT" && cbHire !=="Off" && cbLienASS !== "Off" && cbFL !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 57.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 59.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 67.25;}

if (TTT === "DUP" && cbHire ==="Off" && cbLien === "Off" && cbFL !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 75.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 77.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 85.25;}

if (TTT === "DUP" && cbHire ==="Off" && cbLien !== "Off" && cbFL !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 77.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 79.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 87.25;}

if (TTT === "DUP" && cbHire !=="Off" && cbLien === "Off" && cbFL !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 54.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 56.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 64.25;}

if (TTT === "DUP" && cbHire !=="Off" && cbLien !== "Off" && cbFL !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 56.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 58.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 66.25;}

if (TTT === "DUPLOST" && cbETIT !== "Off" && cbFTIT === "Off") {event.value = 0.00;}
else if (cbETIT === "Off" && cbFTIT !== "Off") {event.value = 10.00;}

if (TTT === "DUPTRT" && cbHire ==="Off" && cbLien === "Off" && cbFL !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 150.50;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 153.00;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 160.50;}

if (TTT === "DUPTRT" && cbHire ==="Off" && cbLien !== "Off" && cbFL !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 152.50;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 155.00;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 162.50;}

if (TTT === "DUPTRT" && cbHire !=="Off" && cbLien === "Off" && cbFL !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 150.50;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 153.00;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 160.50;}

if (TTT === "DUPTRT" && cbHire !=="Off" && cbLien !== "Off" && cbFL !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 110.50;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 113.00;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 120.50;}

if (TTT === "SAT" && cbFL !== "Off" && cbLien === "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 7.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 9.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 17.25;}

if (TTT === "SAT" && cbFL !== "Off" && cbLien !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 9.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 11.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 19.25;}

if (TTT === "SAT" && cbFL === "Off" && cbLien === "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 17.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 19.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 27.25;}

if (TTT === "SAT" && cbFL === "Off" && cbLien !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 19.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 21.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 29.25;}

if (TTT === "OUTREB" && cbHire === "Off" && cbFL !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 75.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 77.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 85.25;}

if (TTT === "OUTREB" && cbHire === "Off" && cbFL === "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 85.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 87.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 95.25;}

if (TTT === "OUTREB" && cbHire !== "Off" && cbFL !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 54.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 56.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 64.25;}

if (TTT === "OUTREB" && cbHire !== "Off" && cbFL === "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 64.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 66.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 74.25;}

if (TTT === "DER") {event.value = 5.50;}// Derelict Motor Vehicle Certificate

if ((TTT === "ONT" || "OUT" || "TRT") && (VEHTYPE === "ATV" || "OHMC" || "ROV") && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off" && cbOHTD !== "Off") {event.value = 37.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off" && cbOHTD !== "Off") {event.value = 39.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off" && cbOHTD !== "Off") {event.value = 44.25;}

if (TTT === "DUP" && (VEHTYPE === "ATV" || "OHMC" || "ROV") && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off" && cbOHTD !== "Off") {event.value = 23.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off" && cbOHTD !== "Off") {event.value = 25.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off" && cbOHTD !== "Off") {event.value = 30.25;}

if (TTT === "LMOF" && (VEHTYPE === "ATV" || "OHMC" || "ROV") && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off" && cbOHTD !== "Off") {event.value = 34.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off" && cbOHTD !== "Off") {event.value = 36.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off" && cbOHTD !== "Off") {event.value = 41.25;}

if (TTT === "OFTD" && (VEHTYPE === "ATV" || "OHMC" || "ROV") && cbOHTD !== "Off") {event.value = 4.00;}

if ((TTT === "ONT" || "TRT") && VEHTYPE === "VS" && cbFL !== "Off" && cbLien === "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 5.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 7.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 10.25;}

if (TTT === "ONT" && VEHTYPE === "VS" && cbFL === "Off" && cbLien === "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 9.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 11.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 14.25;}

if ((TTT === "ONT" || "TRT") && VEHTYPE === "VS" && cbFL !== "Off" && cbLien !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 6.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 8.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 11.25;}

if (TTT === "ONT" && VEHTYPE === "VS" && cbFL === "Off" && cbLien !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 10.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 12.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 15.25;}

if (TTT === "DUP" && VEHTYPE === "VS" && cbLien === "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 6.00;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 8.50;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 11.00;}

if (TTT === "DUP" && VEHTYPE === "VS" && cbLien !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off" ) {event.value = 7.00;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 9.50;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 12.00;}

if (TTT === "DUPTRT" && VEHTYPE === "VS" && cbLien === "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 11.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 13.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 16.25;}

if (TTT === "DUPTRT" && VEHTYPE === "VS" && cbLien !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 12.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 14.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 17.25;}

if (TTT === "DUPLOST" && VEHTYPE === "VS" && cbFTIT !== "Off") {event.value = 5.00;}
else {event.value = 0.00;}

 

TOPICS
How to, JavaScript

Views

75

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Explorer , Feb 20, 2021 Feb 20, 2021
Ist Argumentif ((TTT === "ONT") && (VEHTYPE !== "MH") && (BTA !== "PC" || "MH") && (cbHire === "Off") && (cbLien === "Off"))  if (cbETIT !== "Off"){event.value = 77.25;}  if (cbPTIT !== "Off") {event.value = 79.75;}   else  (cbFTIT !== "Off"){event.value = 87.25;} 2nd Argumentif ((TTT === "ONT") && (VEHTYPE !== "MH") && (BTA !== "PC" || "MH") && (cbHire === "Off") && (cbLien !== "Off")  if (cbETIT !== "Off"){event.value = 79.25;}  if (cbPTIT !== "Off") {event.value = 81.75;}   else  (cbFTIT !== ...

Likes

translate

Translate

Translate
Adobe Community Professional ,
Feb 19, 2021 Feb 19, 2021

Copy link to clipboard

Copied

With your script you will get only 5.00 or 0.00

 

It uses always the last if statement.

 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 20, 2021 Feb 20, 2021

Copy link to clipboard

Copied

I went back and read Tom's article on if/else; will grouping the conditions in the statement help? Here's what I had vs now grouped. 

Argument/Conditions in pararenthesis separated by the operators 

if ((TTT === "ONT") && (VEHTYPE === "MH") && (cbHire === "Off") && (cbLien === "Off") && (cbETIT !== "Off") && (cbPTIT === "Off") && (cbFTIT === "Off")) {event.value = 76.25;}
else if ((cbETIT === "Off") && (cbPTIT !== "Off") && (cbFTIT === "Off")) {event.value = 78.75;}
else if ((cbETIT === "Off") && (cbPTIT === "Off") && (cbFTIT !== "Off")) {event.value = 86.25;}

Argument/Conditions not in pararenthesis separated by the operators (original method) 

if (TTT === "ONT" && VEHTYPE === "MH" && cbHire === "Off" && cbLien !== "Off" && cbETIT !== "Off" && cbPTIT === "Off" && cbFTIT === "Off") {event.value = 78.25;}
else if (cbETIT === "Off" && cbPTIT !== "Off" && cbFTIT === "Off") {event.value = 80.75;}
else if (cbETIT === "Off" && cbPTIT === "Off" && cbFTIT !== "Off") {event.value = 88.25;}

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Feb 20, 2021 Feb 20, 2021

Copy link to clipboard

Copied

You can group it like this:

if (cbETIT == "Off") {
  if (cbPTIT == "Off") {
    ...
  } else {
    ...
  }
} else {
  if (cbPTIT == "Off") {
    ...
  } else {
    ...
  }
}

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 20, 2021 Feb 20, 2021

Copy link to clipboard

Copied

Ist Argument

if ((TTT === "ONT") && (VEHTYPE !== "MH") && (BTA !== "PC" || "MH") && (cbHire === "Off") && (cbLien === "Off"))

  if (cbETIT !== "Off"){event.value = 77.25;}
  if (cbPTIT !== "Off") {event.value = 79.75;} 
  else  (cbFTIT !== "Off"){event.value = 87.25;}

 

2nd Argument

if ((TTT === "ONT") && (VEHTYPE !== "MH") && (BTA !== "PC" || "MH") && (cbHire === "Off") && (cbLien !== "Off")

  if (cbETIT !== "Off"){event.value = 79.25;}
  if (cbPTIT !== "Off") {event.value = 81.75;} 
  else  (cbFTIT !== "Off"){event.value = 89.25;}

 

and continue to set the rest of the arguments to whether title is electronic, paper or print on demand (FTIT for fast title)? Do I need anything between successive argument blocks, like curly brackets? Thanks Bernd for your help and in advance for your response.-  kemper

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Feb 20, 2021 Feb 20, 2021

Copy link to clipboard

Copied

I know nothing about all your conditions.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 21, 2021 Feb 21, 2021

Copy link to clipboard

Copied

The Conditional Argument beginning with 'if' followed by a series of checkboxes and dropdowns previously selected in the form that all combine to apply certain fees to motor vehicle titles and registrations. I work in the FL dept of motor vehicles and have customers who have difficulty filling out the state forms. I'm trying to make it easier by creating a user-form that calculates fees based on user's selections and autofills the appropiate state forms for the customer.

For example,

var TTT = this.getField("Transaction_Type").value;
var cbLien = this.getField("Lien1_Fee").value;
var cbLienASS = this.getField("Lien1_Fee").value;
var cbFL = this.getField("CheckBox_Florida").value;
var cbETIT = this.getField("CheckBox_Electronic_Title").value;
var cbPTIT = this.getField("CheckBox_Paper_Title").value;
var cbFTIT = this.getField("Fast_Title").value;
var cbHire = this.getField("CheckBox_ForHire").value;
var VEHTYPE = this.getField("Vehicle_Type").value;
var BTA = this.getField("BodyAuto").value;
var BTTR = this.getField("BodyTruck").value;
var BTMC = this.getField("BodyMotorCycle").value;
var BTOH = this.getField("BodyOffHighway").value;
var BTTO = this.getField("BodyTools").value;
var BTVT = this.getField("BodyVehicleTrailer").value;
var BTVS = this.getField("BodyVessel").value;
var BTBS = this.getField("BodyBus").value;
var BTTT = this.getField("BodyTravelTrailer").value;
var BTAM = this.getField("BodyAmphibian").value;
var BTMH = this.getField("BodyMobileHome").value;
var CC = this.getField("Class_Codes").value
var cbOHTD = this.getField("OHV_Title_Decal").value;
var CUST1STATE = this.getField("Customer_1_State").value;
var REGUSE = this.getField("Registration_Use").value;
var cbCTVSFEE = this.getField("County_Vessel_Fee").value;
var cbREDVSFEE = this.getField("Vessel_Reduced_Fee").value;
var cbVSDEALREG = this.getField("Dealer_Vessel_Registration_Fee").value;

 

if ((TTT === "ONT") && (VEHTYPE !== "MH") && (BTA !== "PC" || "MH") && (cbHire === "Off") && (cbLien === "Off"))//Original New Title, all vehicles except Mobile Homes and automobiles with body types                                     Private Coach or Motor Home. not For Hire, with lien
     if (cbETIT !== "Off") {event.value = 77.25;}cost of electronic title
     if (cbPTIT !== "Off") {event.value = 79.75;} cost of mailing title
     else (cbFTIT !== "Off") {event.value = 87.25;} cost of printing title

 

if ((TTT === "ONT") && (VEHTYPE !== "MH") && (BTA !== "PC" || "MH") && (cbHire === "Off") && (cbLien !== "Off")) //Original New Title, all vehicles except Mobile Homes and automobiles with body types                                     Private Coach or Motor Home. not For Hire, with lien
     if (cbETIT !== "Off") {event.value = 79.25;} cost of electronic title
     if (cbPTIT !== "Off") {event.value = 81.75;}  cost of mailing title
     else (cbFTIT !== "Off") {event.value = 89.25;} cost of printing title

 

I have about 125 of these if/else blocks in the custom calculation box of a textField named TOTAL_FEES in an attempt to calculate the total cost to the customer to title and register their motor vehicle. Should I be using 'else if' rather than 'else' at the end of blocks? I can send you the Notepad file containing the scripts, but I'd rather not place it on the post. Thank you Bernd.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 21, 2021 Feb 21, 2021

Copy link to clipboard

Copied

correction, 1st argument there is no lien   (cbLien === "Off")

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 20, 2021 Feb 20, 2021

Copy link to clipboard

Copied

Is there a way to have all the statements evaluated versus only the last one- or do I need to put the brakes on my project until I learn arrays and switches?

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 20, 2021 Feb 20, 2021

Copy link to clipboard

Copied

nope grouping didn't help- advice? Can send form for eval.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines