Conditional logic to show/hide specific fields is not working

  • csnow
    Asked on May 30, 2016 at 8:50 AM

    I am trying to hide/show specific fields with question "How many dependents live in this household" (number 61). If the person puts none or the field is empty, all field for the dependents are hidden.  If the respondent checks one, only certain fields for Dependent 1 are shown.  Similarly, if the respondent checks two, only certain fields for Dependent 1 & Dependent 2 are shown.  Then, if the person checks that the 2016-2017 Grade/Year is between Newborn & 12 inclusive, the remaining health fields are to show.  If the person checks any of the college or other field, these fields are to be hidden.  I cannot even get the form to show specific fields.  This was working and now it stopped, but it's working for the question before: How Many Adults live in this household.

  • Kiran Support Team Lead
    Replied on May 30, 2016 at 10:26 AM

    I have checked your JotForm and see that the conditions for the questions How many independent adults currently live in this household? and How many dependents live in this household? are working fine at my end.

    Conditional logic to show/hide specific fields is not working Image 1 Screenshot 20

    Also, are you referring to the conditions related to the field "2016-2017 Grade/Year" within the Dependent sections? If so, I see that there are no conditions set for the field "2016-2017 Grade/Year" to show the Health fields? Did you make any changes to the form conditions recently?

    Did you make any changes to the form conditions recently? Since you say that the form was working correctly, could you try restoring the form to an earlier version from the Form revision history if there were any changes made to the form? Please refer to the guide below that can help you in reverting the form to an earlier version.

    http://www.jotform.com/help/294-How-to-View-Form-Revision-History

    Hope this information helps! If you need any further assistance, please let us know. We will be happy to help. 

  • csnow
    Replied on May 30, 2016 at 10:51 AM

    Thanks for responding.  Let me clarify as to what I am wanting. As it stands now, if a respondent clicks on the number for dependent adults (none, one, two, etc), the corresponding fields for the correct number of Dependents emerge.  However, all the fields emerge.  I had wanted the fields from Full Name through 2016-2017 Grade/Year for each Dependent section to emerge.  Then, if the respondent entered Newborn-Toddler through 12 in the 2016-2017 Grade/Year field, the remainder health fields would show (Pediatrician, phone number, immunizations, allergies, special health needs).  We really don't need that information for college kids or other adults living at home.  So, if the respondent entered any of the college options or Other, those fields would not show.  I originally had the conditional logic state that only those fields would show (Full Name through 2016-2017 Grade/Year) and then I had another conditional logic attached to the 2016-2017 Grade/Year field that health fields would show depending on the grade chose.  However, that really did not work.  I got crazy results with that.  Then, I set it up as it is now with all fields showing for each section, and attached a conditional logic to 2016-2017 Grade/Year in which if the respondent entered one of the four college options or other, those remaining health questions would be hidden.  That did not work either.

    I hope this clarifies what I'm looking for.

  • Welvin Support Team Lead
    Replied on May 30, 2016 at 12:16 PM

    Thank you for the clarification. 

    To fix this, you would need to remove the fields "Pediatrician" up to "Special Health Needs (or Write "None"):" in the conditions for the field "How many dependents live in this household?". Here's an illustration:

    Conditional logic to show/hide specific fields is not working Image 1 Screenshot 30

    You need to deselect #72 up to #76. Again, you need to do this for the entire options for the "How many dependents live in this household?" field.

    After doing this, simply add a new set of condition to show the fields when Newborn - Toddler up to 12 is selected from the 2016-2017 Grade/Year dropdown field. 

    Conditional logic to show/hide specific fields is not working Image 2 Screenshot 41

    Here's a cloned version of your form showing the changes for the Dependant 1: https://form.jotform.com/61504480558962

    Let us know if you need any further assistance.

  • csnow
    Replied on May 30, 2016 at 1:17 PM

    So, I did what I think you instructed.  It worked until I got to the option of having five dependents. When I added conditions if the respondent clicked None, One, Two, Three, and Four it worked.  I checked each condition after I added the conditional logic statements.  However, when I added the conditions for when they click five dependents, it went haywire.  The Universal Application has modifications to the first four conditions & works well if you check None, One, Two, Three or Four (I don't know what happens if you check five) (https://form.jotform.com/61458148445158). I then cloned it (Clone of Universal Application) and changed the fifth condition (https://form.jotform.com/61504861861154).  If you check one, two, three, etc., it's a mess. What am I doing incorrectly?

  • Ashwin JotForm Support
    Replied on May 30, 2016 at 1:42 PM

    Hello csnow,

    I did check your form and found that the condition seems to work just fine. Please check the screenshot below:

    Conditional logic to show/hide specific fields is not working Image 1 Screenshot 20

     

    Please be noted that there is a better way to organize your conditions. You can just add one condition to show / hide multiple form fields by adding "Form Collapse" field in form. You may like to take a look at the following guide which should help you:  https://www.jotform.com/help/297-Show-or-Hide-multiple-fields-at-once-using-form-collapse-tool 

    Hope this helps.

    Do get back to us if you have any questions.

    Thank you!

  • csnow
    Replied on May 30, 2016 at 2:28 PM

    It does not work.  As I stated in my previous email, once I add the final conditions to the fifth option, the form does not work.  In the original Universal application in which I have conditions in for options None through four, if I click on Two, I get the following (which is correct):

    Conditional logic to show/hide specific fields is not working Image 1 Screenshot 30

    Now, when I put in the conditional logic for the final & fifth option, which is reflected in Clone of Universal Application, when I click on "Two," I get the following:

     

    Conditional logic to show/hide specific fields is not working Image 2 Screenshot 41

     

    You can see that the fields, Pediatrician through Special Health Needs which should be hidden and only show if a certain grade is selected (see previous emails) are not only visible, but repeat five times.  Please look at the difference between the Universal Application when you click "One," "Two," "Three," etc and when you do that in the Clone of the Universal Application.  For some reason, when I add these final conditional logic statements, it messes things up.  Please advise.

     

  • David JotForm Support Manager
    Replied on May 30, 2016 at 2:53 PM

    I have cloned your forms, please allow me some time to study the conditional logic, and find the solution, I will get back to you as soon as possible.

  • David JotForm Support Manager
    Replied on May 30, 2016 at 3:16 PM

    The conditions are fine, except for one, condition 11 is making the conflict:

    Conditional logic to show/hide specific fields is not working Image 1 Screenshot 40

    Please disable it or delete:

    Conditional logic to show/hide specific fields is not working Image 2 Screenshot 51

    That will fix the problem: https://form.jotform.com/61506241318953 

    Conditional logic to show/hide specific fields is not working Image 3 Screenshot 62

    Why? By setting those fields to show if an specific selection is made, you are hiding them by default. By creating another condition to hide them if no selection has been made, you are forcing them to show when a selection is made. 

    Let us know if you need more help, we will be glad to assist you.

  • csnow
    Replied on May 30, 2016 at 5:20 PM

    That was it!  Thank you so very much for your time.

  • David JotForm Support Manager
    Replied on May 30, 2016 at 5:28 PM

    You are welcome! We are glad to help you, feel free to contact us anytime. :)