Make a field "conditional" mandatory?? - InfoPath Dev

InfoPath Dev

Use our Google Custom Search for best site search results.

Make a field "conditional" mandatory??

Last post 01-21-2019 09:28 AM by Daryl K. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-21-2019 06:50 AM

    Make a field "conditional" mandatory??

    Looking for ideas on this one. I have a form that has 8 "potential" sections, each with a field that needs to be mandatory, but only if that section is visible.

    For any given submission between 1 and 8 of the fields may be visible, with the remainder hidden. This is the normal use of the form, so obviously just marking the field "mandatory" on all 8 won't work because the form will enforce it even on unused (hidden) sections.

    So the idea is that is the section is visible I want to enforce that a field is not blank, while if the section is hidden do nothing.

    Andy thoughts?
  • 01-21-2019 08:00 AM In reply to

    Re: Make a field "conditional" mandatory??

    You just need to use a validation rule. What ever the conditions are under which the section should show would be the condition for the field to be required. See attached sample - save locally, right click and select design, then you can preview, etc. Instead of hiding the sections, I've set the background color so you can easily see when the field in each section is required.
    Hilary Stoupa

  • 01-21-2019 08:59 AM In reply to

    Re: Make a field "conditional" mandatory??

    Hmm, seems simple enough, but I am missing something. I added the rule "validation" and the condition was the same as those which make that section visible, but I can still save and close the form with that field blank and I get no error.
  • 01-21-2019 09:28 AM In reply to

    Re: Make a field "conditional" mandatory??

    Got it! I re-uploaded the form and it fixed that - but then I was getting a validation error even if I filled in the field, but that turned out to be a stupid typo.

    At any rate, I had never played with validation rules before, so thank you! It fixed my issue.
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.