Custom If formula and dropdown lists.
Hi.
I'm trying to create a form pdf with a dropdown option (field named "CarClav"). Currently, the list has 6 options, plus one blank default option.
I'm trying to configure it so it writes in another field ("ModCar") a number that is on diferent fields, depending on the option selected on the list.
Example:
If "CarClav" is "Fue", write the value of the field "ModFue" on the "ModCar" field.
If "CarClav" is "Des", write the value of the field "ModDes" on the "ModCar" field.
If "CarClav" is "Sab", write the value of the field "ModSab" on the "ModCar" field.
Currently, I've solved most of this, I guess. My code looks like this (CustomKeystrokeScript on the Format tab)
if(event.willCommit)
{
console.println(event.value);
switch(event.value)
{
case "FUE":
this.getField("ModCar").value = 1;
break;
case "DES":
this.getField("ModCar").value = 2;
break;
case "CON":
this.getField("ModCar").value = 3;
break;
case "INT":
this.getField("ModCar").value = 4;
break;
case "SAB":
this.getField("ModCar").value = 5;
break;
case "CAR":
this.getField("ModCar").value = 6;
break;
default:
this.getField("ModCar").value = "";
break;
}
}
[Note: emphasis was added where the problem is. I would like to change the results (1-6) to the value of respective fields, as noted before]
Thank you!