Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

If statement not executing from variable.

Avatar

Avatar
Boost 1
Level 1
Duquette
Level 1

Like

1 like

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
Duquette
Level 1

Like

1 like

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile
Duquette
Level 1

08-02-2021

I have a form that once filled in creates a document based on the users input. For some reason, the if statement are not reading the variable to select the proper event to execute. The same if statements are used in other parts of the document to spawn the required pages and work perfectly. I can not find any problems in the code and the debugger shows ReferenceError: tr1 is not defined. 2:Field:Calculate.The problem is with variable" tr1, tr2 . Thank you for any help / advice you may have

 

if ((hppn.value !== "")&&(h2s.value !== "")){

// Jumbo Injection Trailer, T-Trailer & 407 Chemical Trailer Deployed;
if ((tr1.value > 0)&&(tr2.value > 0)&&(tr3.value > 0)){
event.value = "Statement 1";
}

// Jumbo Injection Trailer & 407 Chemical Trailer Deployed;
if ((tr1.value > 0)&&(tr2.value === 0)&&(tr3.value > 0)){
event.value = "Statement 2";
}

// Jumbo Injection Trailer and T-Trailer Deployed;
if ((tr1.value > 0)&&(tr2.value > 0)&&(tr3.value === 0)){
event.value = "Statement 3";
}

// Jumbo Injection Trailer Deployed;
if ((tr1.value > 0)&&(tr2.value === 0)&&(tr3.value === 0)){
event.value = "Statement 4";
}

// 407 Chemical Traile(s) deployed;
if ((tr1.value === 0)&&(tr2.value === 0)&&(tr3.value > 0)){
event.value = "Statement 5";
}

// T-Trailer(s) deployed;
if ((tr1.value === 0)&&(tr2.value > 0)&&(tr3.value === 0)){
event.value = "Statement 6";
}
}

Accepted Solutions (0)

Answers (0)