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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

If Then statement question, multiple conditions

Gene--O
Level 4
Level 4

I am trying to create a form where I have 2 boxes that a user can put a number in, and a third box that inserts a number based on what is put into the first 2 boxes.The default value for all 3 boxes is 0. For example, if the 1st box contains any number greater than 0, the number 7 is put into the 3rd box. However, regardless of what is in the 1st box, if the 2nd box contains a number greater than 0, the number 24 is put into the 3rd box. I am using FormCalc. Any help  is appreciated!!!!!

1 Accepted Solution
pguerett
Correct answer by
Level 10
Level 10

The issue is that you have a capital I in the If satatement. Make it a lowercase i

Paul

View solution in original post

0 Replies
pguerett
Level 10
Level 10

Assuming the boxes are called Box1, Box2 and Box3. I woudl also use Javascript (it is much more widely used) although you can use FormCalc if you insist. The code would look something like this:

if (Box1.rawValue > 0){

     Box3.rawValue = 7;

}

if (Box2.rawValue > 0){

     Box3.rawValue = 24;

}

paul

Gene--O
Level 4
Level 4

Paul,

I inserted the code as you said, but am not getting anything placed into Box3. I'm not sure what I'm doing wrong. I am attaching the file so you can see. If you look at the bottom of the 2nd page, it is the boxes for "Reprimand" (Box1) and "Suspension" (Box2) under "Disciplinary Actions" and "Disciplinary Score" (Box3). If any value greater than 0 is put into "Reprimand", then "Disciplinary Score" should show "7". Regardless of what is put into "Reprimand", if any value greater than 0 is put into "Suspension", then "Disciplinary Score" should show "17" (not 24 as I originally posted).

Thanks for your help!!!

Gene-O

pguerett
Correct answer by
Level 10
Level 10

The issue is that you have a capital I in the If satatement. Make it a lowercase i

Paul

View solution in original post

Gene--O
Level 4
Level 4

You are my hero!!!

Thanks so much, however, I have one more issue: I also would like to add a statement that basically says that if Box1 and Box2 are both = 0, then Box 3=0. But that statement cannot interfere with the other statements. It is just a way to return everything to 0. The reason is once I enter a number into Box1 or Box2, then I cannot zero out Box3 again.

Thanks again!

Gene--O
Level 4
Level 4

Paul,

I got it figured out. Thanks again for your help!!!!

Merry Christmas

Gene-O