If an input field is != null display a integer in the output
Hi Everyone
I want my program to detect if a field has an entry and if it has an entry set the output field to a value. Currently the program gets stuck on the if statement.
The following code is in custom calculation script. Running on Adobe Acrobat Pro 2017. Also if there is a easier way to do this please let me know, thanks in advance.
var nameOne = this.getField("Name1").valueAsString;
var nameTwo = this.getField("Name2").valueAsString;
var nameThree = this.getField("Name3").valueAsString;
var nameFour = this.getField("Name4").valueAsString;
var nameFive = this.getField("Name5").valueAsString;
if( nameOne != "null"){
event.value=1;
}
else if(nameOne && nameTwo != "null"){
event.value= 2;
}
else if(nameOne && nameTwo && nameThree != "null"){
event.value= 3;
}
else if(nameOne && nameTwo && nameThree && nameFour != "null"){
event.value= 4;
}
else if(nameOne && nameTwo && nameThree && nameFour && nameFive != "null"){
event.value= 5;
}
