If/Else Statement PDF Form
Hi Adobe Community,
I am just starting out in learning how to use javascript in the custom calculation script. I am creating a check checklist where each check box equals a value of 1, and that value is totaled at the base of the check list in box A (steps completed.) My next goal is to have the box below (B) either show "NO" or "YES" depending on the value of A. For example, there are 17 steps so if A's value is 0-16 B would be NO and if the value is 17 than it would say YES - meaning the check list is complete or not. Right now, I can only every get B to always say NO or always say YES. I know I am probably making a very basic mistake, but if anyone can help me with my code I would really appreciate it. And is it possible to color the text so that NO would be in red or YES would be green, or is that only possible in excel? Thanks in advance!
var v1 = this.getField("A").value;
var v2 = this.getField("B").value;
if (v1 = 0) event.value = "NO";
else if (v1 = 1) event.value = "NO";
else if (v1 = 2) event.value ="NO";
else if (v1 = 3) event.value = "NO";
else if (v1 = 4) event.value = "NO";
else if (v1 = 5) event.value = "NO";
else if (v1 = 6) event.value = "NO";
else if (v1 = 7) event.value = "NO";
else if (v1 = 😎 event.value = "NO";
else if (v1 = 9) event.value = "NO";
else if (v1 = 10) event.value = "NO";
else if (v1 = 11) event.value = "NO";
else if (v1 = 12) event.value = "NO";
else if (v1 = 13) event.value = "NO";
else if (v1 = 14) event.value = "NO";
else if (v1 = 15) event.value = "NO";
else if (v1 = 16) event.value = "NO";
else if (v1 = 17) event.value = "YES";
