Conditional if/then doesn't clear when data in related field(s) is deleted.
I have form of 12 rows, each with the following calculation in a field 'CD#Result' (the first two letters of the fields change per row). "A" is a single field and "B" is a total of three other fields, that when compared to A determines what is in 'CD#Result'.
It works almost perfectly. However, I realized I have a problem if the user changes their mind. If they make any entry in A or any of the three other fields and then delete those entries, the Result field does not clear. I used the validation script to hide any 0 total in the 'CD#MoTotal' field to get a blank, but can't figure out how to do that in the Results field, or how to add to the calculation below.
What I want is that if both 'CD#Expect' and 'CD#MoTotal' are blank, then the 'CDResult' should be blank too.
TIA for your help!
var A = this.getField("CD#Expect").value; // Expected Activity for period reviewed;
var B = this.getField("CD#MoTotal").value; // Actual Activity for period reviewed;
if (B>A) { event.value = "Exceeds";}
else if(B<A) { event.value = "Under"; }
else if (B=A) { event.value = "Meets";}
validate for 'CD#MoTotal':
if (event.value == 0) event.value = "";
