Nested If Statements
Hi
i am trying to create a form to that has a text field change color to either green or red depending on three things. the first variable is a the text field "wpds1", the second is text field "dia1" and the third is the text field "Amps". the user would input UB36 into the "wpds1" text field and either 5/32 or 1/8 into the "dia1" text field. When the user inputs a number into the "Amps" text field i want the color to change based on the input. here is what i got so far.
var f = event.value;
var wpds = this.getField("wpds1").value;
var dia = this.getField("dia1").value;
if (wpds = "UB36")
{
if (dia = "1/8")
{
if(f >= 70 && f < 131) {event.target.fillColor = ["RGB",0.800,1,0.800] ;}
else {event.target.fillColor = ["RGB",1,0.700,0.700]}
}
else if (dia = "5/32")
{
if(f >= 115 && f < 176) {event.target.fillColor = ["RGB",0.800,1,0.800] ;}
else {event.target.fillColor = ["RGB",1,0.700,0.700]}
}
}
The issue that i am having is when i enter 5/32 into the "dia" text field it is still running off of the numbers for 1/8. so when i put UB36 into "wpds1" and 5/32 into "dia" the range that changes the fill color to the desired color is still the 70 - 130.
