Creating Conditonally Required Fields in InfoPath

Program: InfoPath 2010 (2007 form template)

I spent the best part of two days trying to figure out the following; hopefully it will prevent someone else from wasting a bunch of time trying to figure out the same thing.

So I have a form in InfoPath where I want to make some fields required only if another field is selected first. I created a validation rule that appeared to do what I wanted until I tried to submit the form. The conditionally required fields were outlined in red even though they contained data and the form refused to submit. After digging around a bunch of InfoPath dev forums, I kept seeing the same reference to “add a rule making the field blank”. Here are the steps to creating a conditionally required field in InfoPath (I am using InfoPath 2010 so the exact directions may need to be tweaked for 2007 users):

  1. Select the field that should be conditionally required. In the Rules pane, select New > Validation. Name the rule.

  2. Under Condition, click on the None link. You will be adding two conditions. The first condition is:

    (field that determines whether or not the other field is required) (is equal to) (True)

    This assumes the first field is a checkbox. If you have radio buttons with a specific choice, like Yes and No, make sure the radio selectors have values:

    (field that determines whether or not the other field is required) (is equal to) (Yes)

  3. Click the Add button to add a second condition:

    (field that should be optionally required) (is blank)

  4. Click OK. Here is what the completed rule should look like:

  5. In the ScreenTip field enter “Required

  6. To test your form, click the Preview Form button in the ribbon. The conditionally required field should display as not required until the field that makes the field required is selected. The field should now display a red asterisk indicating it is required. Once data has been entered and the focus removed from the field, the form should show no validation errors.

    What the fields look like on load:

    What the fields look like on load:



    Selecting the field that sets the other field to be required:

    Selecting the field that sets the other field to be required:

    After data has been entered into the field and focus has left field:

    After data has been entered into the field and focus has left field:

About these ads

31 thoughts on “Creating Conditonally Required Fields in InfoPath

  1. any idea how you would do this with a ‘people picker’ field … because that doesn’t allow you to add a validation rule ?

  2. just to follow up on jeff… any idea how you would do this with a ‘people picker’ field … because that doesn’t allow you to add a validation rule ?.. i also need a solution for this :)

  3. I have exact same requriement in all my infopath forms. I tried exactly same way but it didnt work for me.This is urgent.
    Please help!

  4. Thanks for this terrific article. It did the trick for one of two conditional fields.

    I noticed that on multiChoice Fields, the validation rule option does not appear. How would you do it if you had a conditional on a multichoice field? I tried to add an extra statement in the first rule saying (if dropdown one is blank OR multi…is blank,) and that didn’t work.

  5. This is just a thought .. The people picker does not allow any validation to be filled in .. however what we can do is create a temp text field… create an action rule on this which says “If people group picker is not empty Set temp_field to value “1” ” … Now this temp field can be used as the entry by which you can set your field validation condition .. i.e. put the condition in the validation of field A as “if temp_field is equal to “1” ”

    Hope this will help someone !! Do tell us all if this works !

  6. Pingback: How to create conditionally required fields in InfoPath | Jack Tingzon's Blog

  7. I have a request from a department for a form to have all question in a column answered before a signature could be added to the form for that section. The form contains 2 columns A and B and each column has a list of question which answer is driven from a drop down depending on the state of the project. I am not sure how to make this happen. Is this possible as a no code solution?

    Example of the form below.

    Question’s Column A(50% complete) Column B(100%Complete)
    Q1 Drop down Drop down
    Q2 Drop down Drop down
    Q3 Drop down Drop down
    Sig from column A
    Sig from Column B

    I am new to InfoPath but I just feel like I am asking google the wrong question. I am guessing this is a validation rule of some sort. If I am wrong and someone could point me in the right direction it would be a lot of help. The signature portion will have a digital signature as well. Not sure if that matters or not.
    Any help would be greatly appreicated.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s