For each item j all must qualify

I have the following, but I want ALL text inputs, which don’t contain the word “optional” in the hint, to be required to have something in the field.

Currently, a user could just enter the Last Name field and it will allow them to pass to the next page.

I understand the j loops through & when it gets the last input and it has text, then it qualifies the block requirements.
Am I missing a simple solution to requiring ALL which don’t have “optional” instead of just the last one?

I don’t want to do a count variable because then it would be required to be 2/3. I’d rather just ALL that aren’t optional must have some text.

Thanks again

1 Like

Could you share the full image of the blocks?
Would make it a little bit easier to see whats wrong.

Thanks

You’re checking for the text input to be non-empty (not equal to “”). Instead, set a variable value to false before the loop starts and then check for the text input to be empty (=“”). If you find it’s empty, change the variable to true. Once the loop completes, if the variable is still false, the form is completed.

1 Like

So for the first loop it checks if the First Name is empty
if yes, then keep variable false

Next loop does input contain (optional)
if yes, skips

Third loop, is input empty,
if no, change variable to true.

True would now allow the user to pass to the next screen even though the First Name was blank

I solved it with a break out of loop block

This forces if something is in fact blank, it just quits the operation entirely and prevents access to the next page from the user.

1 Like

So for the first loop it checks if the First Name is empty
if yes, then keep variable false

This is not what I said. If the input is empty, you change the variable to true. If it’s not empty, you ignore it.

Your variable can be called something like “found empty input”.

I see sorry, so it’s effectively the same thing as the break out block but without the variable. Sorry again for my misunderstanding

2 Likes

That’s okay, I’m glad you got it working with a break out block.

1 Like