Using "Cannot leave Blank" in a text box property/dropdown menu, but only if previous question is answered "yes" - InfoPath Dev
in

InfoPath Dev

Using "Cannot leave Blank" in a text box property/dropdown menu, but only if previous question is answered "yes"

Last post 10-29-2015 12:28 PM by Jenkins150. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 09-22-2015 05:28 AM

    Using "Cannot leave Blank" in a text box property/dropdown menu, but only if previous question is answered "yes"

    I have a travel form that requires many different parts but some questions only have to be answered if a traveler answers yes to a question first. For example- the question is "Is this a single destination trip?" If the answer is Yes, then the traveler must answer the sub questions linked to that (depart from, arrive to, time frame, dates etc) If the answer is no, then the sub questions are not required and the traveler then answers the question "Is this a multiple destination trip? If the answer is Yes, then the traveler must ask the sub questions linked to that (depart from, arrive to, time frame, dates etc). Right now I have my form set that you can not see the questions for single or multiple destination because I used a rule that if drop down box (Select, Yes, No) is on Select for "Is this a single destination trip?" and "Is this a multiple destination trip?" the sub questions are hidden (in 2 separate sections). Is there any way to make the questions within a section required but only if the initial question is answered yes? I assume this is a rule but I can't figure it out.
  • 09-23-2015 03:33 PM In reply to

    Re: Using "Cannot leave Blank" in a text box property/dropdown menu, but only if previous question is answered "yes"

     You should be able to use validation rules for this. You could have a condition like "Is this a single destination trip" = "Yes" and Depart From is blank, show the cannot be blank warning. I've attached a simple sample - save it locally and then right click and select design to open in design mode.

    Hilary Stoupa

  • 10-02-2015 06:50 AM In reply to

    Re: Using "Cannot leave Blank" in a text box property/dropdown menu, but only if previous question is answered "yes"

    Thanks for the reply. Unfortunately, I am unable to open your example. I have set the condition like "Is this a single destination trip" = "Yes" and Depart From is blank, show the cannot be blank warning. But the issue is, if it is a multiple destination trip, and the person keeps the single destination trip as "select" or puts "no" for single destination trip, the cannot be left blank requirements for the single destination trip should not be required (since they are filling out the multi destination trip).
  • 10-02-2015 07:34 AM In reply to

    Re: Using "Cannot leave Blank" in a text box property/dropdown menu, but only if previous question is answered "yes"

    Do you get an error when you try to open the example form? What version of InfoPath are you using? Did you download the file, then right click the downloaded file and select Design?
    Hilary Stoupa

  • 10-14-2015 08:27 AM In reply to

    Re: Using "Cannot leave Blank" in a text box property/dropdown menu, but only if previous question is answered "yes"

    If a traveller is planning a multi destination trip, the single destination trip must be selected at "No". This will hide the single trip but my problem is that there are required parts within the single destination trip that need to be void if they select "no" and use the multi destination trip instead. ( Vise Versa is this problem if travellers want a single destination trip and not multiple (the "cannot leave blank" requires in Multiple destinations must be void) Single Destination trip -> Yes "Cannot leave blank" parts are the arrival and departure dates Single destination trip -> "Cannot leave blank" parts are the arrival and departure dates must not be required any more.
  • 10-14-2015 08:31 AM In reply to

    Re: Using "Cannot leave Blank" in a text box property/dropdown menu, but only if previous question is answered "yes"

    You need to use custom validation instead of "cannot be blank". Add validation rules with conditions like "if single destination trip is yes and this field is blank" and display a message. You didn't tell me what the error was you had with my sample form - did you download it, right click the downloaded file and open in design mode?
    Hilary Stoupa

  • 10-17-2015 10:31 PM In reply to

    Re: Using "Cannot leave Blank" in a text box property/dropdown menu, but only if previous question is answered "yes"

    Hi Hilary, I think you've uploaded the wrong file. Could you please recheck it? Hi, I am uploading a test form, hope this will help.
    Himanshu Saxena
    MSFT
  • 10-19-2015 07:40 AM In reply to

    Re: Using "Cannot leave Blank" in a text box property/dropdown menu, but only if previous question is answered "yes"

     I did! Thanks for letting me know - I removed it.

    Hilary Stoupa

  • 10-29-2015 12:28 PM In reply to

    Re: Using "Cannot leave Blank" in a text box property/dropdown menu, but only if previous question is answered "yes"

    Thanks Hilary, I was finally able to get that working that a pop up would appear to advise people what to do. Appreciate the help. p.s it's infopath 2010 I use.
Page 1 of 1 (9 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.