Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

JavaScript Syntax error

$
0
0

Im gettings a syntax erro and cant figure out why.

var a = this.getField("P1.B1U"); //checkbox
var b = this.getField("P1.EBreak1Min");
var c = this.getField("P1.Break1Min");
var d = this.getField("P1.Break1OK");


if (a.value = "Yes"){ //if checkbox is checked
    if (c.value >= 8 && c.value <= 22){ // then if P1.Break1Min is greater than or equal 8 but less than or eaual to  22    event.value = (.25);    d.value = "";    }    else if (c.value >= 23 && c.value <= 37){    event.value = (.50);    d.value = "";    }    else if (c.value >= 38 && c.value <= 52){    event.value = (.75);    d.value = "";    }    else if (c.value >= 53 && c.value <= 67){    event.value = (1);    d.value = "";    }
}
else if (b.value >= 8 && b.value <= 22){ //P1.B1U not checked and P1.EBreak1Min is greater than or equal 8 but less than or eaual to  22
event.value = (.25);
d.value = "";
}
else if (b.value >= 23 && b.value <= 37){
event.value = (.50);
d.value = "";
}
else if (b.value >= 38 && b.value <= 52){
event.value = (.75);
d.value = "";
}
else if (b.value >= 53 && b.value <= 67){
event.value = (1);
d.value = "";
}
else{
event.value = ("0");
d.value = "Yes";
}

 

 

this is the error I am getting from the java console:

SyntaxError: syntax error

12:Field:Calculate

InvalidSetError: Set not possible, invalid or unknown.

Field.value:6:Field P1.Break1D:Calculate


Viewing all articles
Browse latest Browse all 12130


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>