Cannot be blank function

S

socaprice

Hi all,
Is there a way to set a field to, "Cannot be blank" but only when the
section it is on is displayed?

I have a form that has 4 sections on it, each section is only displayed when
a certain condition is activated - each section contains a repeating table,
on each repeating table there exist a dropdown field tied to a SharePoint
list. I would like this field to have condition that it cannot be blank once
the user is ready to submit the form.

My problem is that when I check the property, "Cannot be blank" fields for
all the sections and I am running the form I keep getting validation errors
on the form for the sections that are not displayed.

How can I only have the validation kick in only when the section is visible?

I hope someone can help with this.

Thanks...
 
A

Adam Harding

Socaprice

Set the condition on the validation to the same trigger as the appearance of
the repeating table as well as not blank. This will provide you with the
complete functionality you require.

Cheers Adam
 
S

socaprice

Thanks, I don't know if I understand what you mean but here is what I tried,
perhaps you can tell me if that is what you meant.

I went to the field on one of the 4 sections I have hidden, and it's data
validation condition I added "if the section is present and the field is
blank then display a message" I then went to each of the sections and did the
same thing on the corresponding field; yet when I run the form it still tells
me there are validation errors even though only one of the sections "is
present".

Is that what you meant by same trigger as the appearance of the repeating
table as the repeating table is on a section that only gets displayed when
the user makes a choice.

I am hoping no strenuous amount of coding is involved, as I am not a
involved user but if have to...

Thanks again in advance.
 
S

S.Y.M. Wong-A-Ton

What is the condition you set on the sections not to display them? You must
take this condition and use it to set data validation on the field on the
section to require the field not to be blank if the condition you set on the
section is not true. Does this make sense?

Example:
- You have a field1 with the text "Test" in it.
- You set conditional formatting on a section to hide the section when
field1 contains text "Test" (field1 = "Test").
- If you have a required field (field2) on the section that needs to be
filled in only when the section is shown, you must set data validation on
field2 that says:
field1 is not equal to "Test" AND field2 is blank

Let me know if it's still unclear.
 
S

socaprice

Thanks to you both, it worked at first I did not understand but then realize
I was actually using the same trigger not realizing that it should be the
opposite of what was in the first trigger. Don't know if I am making sense
but the trigger that hides the section is a "not equal to" and the trigger
that should kick in once the section is shown should be an "equal to".

Thanks again guys you are the best.
 
A

Adam Harding

Yep, you got it. If X is not equal to Y hide this control and if and only if
X is equal to Y apply the validation.

Glad you got it sorted
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top