Infopath validation - show a message based on a control selection?


I'd like to create a form in Infopath 2007 that shows a "hint" type text based on user's selection of a particular dropdown and possibly changes whether another control is required in order to submit (the asterisk). The logic would be:

Dropdown value = X, display "you must enter destination when using this service", and set control2 to REQUIRED.

Dropdown value = Y, display no text, and don't change any required fields (unless user already selected X in dropdown, then put it back to defaults now)

Is that possible WITHOUT code?

And how does that change in Infopath2010 - if at all?

thanks :)
Who is Participating?
Clay FoxConnect With a Mentor Director of Business IntegrationCommented:
Yah this is possible without code in both IP 2007 and 2010.

You have 2 peices.

You have the notifications, which could be a message window or I often use a hidden section or text box. I update the text and make it appear and hide as needed.  

The other issue is control the required peice.  You have to use your own rules. So have a field which controls the required state. Then add a rule on submit or on another required field that if required state is true and control2 is blank show a message and do not complete or whatever to block them until control2 has a value.

Hope that helps.

Start small and play with it a lot to get the feel for it.
runelynxAuthor Commented:
Ok that seems simple enough.

I'm keeping it very simple... 1 dropdown w/ 3 options, and 1 blank rich text field to show messages depending on the selection in the dropdown.

The dropdown has values 1, 2, or 3.

I set a rule to make the rich text field say "test" if the dropdown is "1" - and it works :)   But if you change to 2, 3, or blank, the text stays in the rich text field and I don't really want that. Is there an easy way to make this clear out or do I need to set a rule for each possibility in the dropdown?
runelynxAuthor Commented:
If I make a validation rule to show a ScreenTip - where does that tip show up? I'm in the filler and it doesnt show up unless I make it do a dialog box as well...
runelynxAuthor Commented:
Whoohoo I got it :D

I can add a new rule to blank out the textbox whenever the dropdown changes, and just put that above the other one so it does both.

And i found the screentip, silly little hover thing, not very useful.

One thing, however, still perplexes me...   is it possible to make a control "cannot be blank" (i.e. required) when another control has a certain value?  I can't find any rules to do this...
Clay FoxDirector of Business IntegrationCommented:
You cannot use the default cannot be blank, you have to add the conditions to your rules manually so that the process does not run unless your conditions are met.

Glad you got it.

I have found it just takes lots of tinkering and baby steps to get a good feel for what can be done.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.