Child fields are still shown even if parent fields are hidden

  • Profile Image
    designisgrowth
    Asked on October 19, 2015 at 03: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

     

    DESELECTED

     

     

  • Profile Image
    designisgrowth
    Answered on October 19, 2015 at 04:55 PM

    Any takers for this one?

  • Profile Image
    EltonCris
    Answered 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.

  • Profile Image
    designisgrowth
    Answered 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

  • Profile Image
    EltonCris
    Answered on October 20, 2015 at 01: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:

  • Profile Image
    designisgrowth
    Answered on October 20, 2015 at 09:18 AM

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

    ~ Daniel Villamizar

  • Profile Image
    BJoanna
    Answered 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.