Need Assistance with If and Else If Statement for PDF Form
Hi Adobe Community,
I need your kind assitance in writing an If and Else If Statement. Please find my situation below.
I have two fields named as Vehiclecountduration and Vcd. The Vehiclecountduration is a drop down field with the options - 5 minutes, 15 minutes, 60 minutes and 1 day. This is a required field and thus, the user must choose one of the options. I would like the following to be displayed in the Vcd field.
If in the drop down list in Vehiclecountduration, 5 minutes is selected then I want 5 to be displayed in the Vcd field.
If in the drop down list in Vehiclecountduration, 15 minutes is selected then I want 15 to be displayed in the Vcd field.
If in the drop down list in Vehiclecountduration, 60 minutes is selected then I want 60 to be displayed in the Vcd field.
If in the drop down list in Vehiclecountduration, 1 day is selected then I want 600 to be displayed in the Vcd field.
The Vcd field should be a number field as I want to use it as an input for calculation in another field.
I have written the following script but it is giving syntax error after condition.
var nVcd = this.getField("Vehiclecountduration");
if (( event.value = "5 min") {
nVcd.value = 5;
}
else if (( event.value = "15 min"){
nVcd.value = 15;
}
else if (event.value = "60 min"){
nVcd.value = 60;
}
else if (event.value = "1 day"){
nVcd.value = 600;
}
Thank you.
Kind Regards,
Ridwan Quaium
