Need to fill a field and assign variable values based on whether two other fields are null or populated
I do not understand why this will only work if both fields are populated. I would also like to know if I could assign a value to variable based on what fields are populated. This is what I have so far, any help / guidance would be greatly appreciated.
// Populates fieild based on whether Team or TeamA is populated. If Team is populated it will set the event.value to team and add values to a set of variable. If Team is Null and TeamB is populated it will add a different value to the variables;
var team = this.getField("Team");
var teama = this.getField("TeamA");
var teamz = this.getField("TeamZ");
event.value = "";
if(team.value==null&&teama!==null) { teamz.value=teama.value
}
if(teama.value==null&&team!==null) { teamz.value=team.value
}
if(teama.value!==null&&team!==null) { teamz.value=team.value
}
