Child fields are still shown even if parent fields are hidden

  • designisgrowth
    Asked on October 19, 2015 at 3:56 PM

    Check out this link:

    http://lmclabs.webship.com/client-center/supplies-requisition-forms.html

     

    I have it set up so that it displays products once you click on a service line. The form then displays all the products that have to do with that service line. Once you check mark a product I have a conditional that displays the quantity. The problem that I have is once you deselect the first conditional (the service line) the quantity still shows up and I don't want it to. I have attached images to show what I mean. Thanks for your help!

     

    SELECTED

    Child fields are still shown even if parent fields are hidden Image 1 Screenshot 30

     

    DESELECTED

    Child fields are still shown even if parent fields are hidden Image 2 Screenshot 41

     

     

  • designisgrowth
    Replied on October 19, 2015 at 4:55 PM

    Any takers for this one?

  • Elton Support Team Lead
    Replied on October 20, 2015 at 12:22 AM

    That's because the parent field is still filled even if they are hidden that's why the child fields that depends on it are still shown.

    That can be easily resolved by enabling the "Clear On Being Hidden" option on form preferences.

    Child fields are still shown even if parent fields are hidden Image 1 Screenshot 20

  • designisgrowth
    Replied on October 20, 2015 at 12:40 AM

    Hi EltonCris,

    Thanks for the answer! Do you know where the code to this change is in the source code? I don't want to re-import the source code so if I can just add it manually that would be great.


    Thanks!
    Daniel Villamizar

  • Elton Support Team Lead
    Replied on October 20, 2015 at 1:45 AM

    Sure, that's possible. The script is already on your form source code, you just have to enable it.

    Simply find this code on your form source code JotForm.clearFieldOnHide="disable"; and change disable to enable.

    Example:

    Child fields are still shown even if parent fields are hidden Image 1 Screenshot 20

  • designisgrowth
    Replied on October 20, 2015 at 9:18 AM

    EltonCris,
    Thanks! That worked out perfectly. You guys are the best!

    ~ Daniel Villamizar

  • BJoanna
    Replied on October 20, 2015 at 11:25 AM

    On behalf of my colleague, you are welcome.

    Feel free to contact us if you have any other questions.