The javascript if else statement I am using in LiveCycle is only reading the last else statement and won’t read or recognize the statements that come before it. If you can see what I am missing please help. Here is the code:
if (annualUsage.rawValue < 1,000,000)
{
this.rawValue = annualUsage.rawValue * 0.1;
}
else if (annualUsage.rawValue >= 1,000,000 && annualUsage.rawValue < 10,000,000)
{
this.rawValue = annualUsage.rawValue * 0.2;
}
else (annualUsage.rawValue >= 10,000,000)
{
this.rawValue = annualUsage.rawValue * 0.05;
}
Take the commas out of your numbers? So like
if (annualUsage.rawValue < 1000000)
etc...
Also the last else statement doesn't get a condition so you can either remove the condition
else{
or turn it into an else if statement
else if(annualUsage.rawValue >= 10000000){