I'm receiving the following error:
"Uncaught ReferenceError: Invalid left-hand side in assignment"
From this code:
if (!oPrismaticMaterial = "") {
for (var i = 0; i < oPrismaticMaterial.length; i++) {
if (oPrismaticMaterial[i].checked) {
oPrismaticMaterial[i].checked = true;
radioChecked = true;
break;
}
}
if (!radioChecked) {
bValidated = false;
sErrorMessage += "Please select grades and metal\n";
}
}
You should be using != instead of = in your if statement.
== is a comparison for equal to, != is a comparison for not equal to, = is for assignment.
Therefore you need to change your if statement from:
if (!oPrismaticMaterial = "")
to
if (oPrismaticMaterial != "")
Maybe the "=" has to be an "===", it won't work for "==".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With