Show/Hide field based on selection from Multiple-choice field

  • 416soclean
    Asked on April 14, 2024 at 12:25 AM

    I have been struggling trying to get this to work and was hoping for some support.


    I have to display label 1 - if one check box is selected. And I have to hide that same label and show an alternative label if 2 check boxes are filled.

    I have tried to add some conditions but it does not seem to be working. I have included the screen shot below.

    The red circle should display the third box and hide the second box and the blue circle should display the second box and hide the 3rd box

    Thanks.

    Jotform Thread 13866871 Screenshot
  • Carrissa JotForm Support
    Replied on April 14, 2024 at 5:38 AM

    Hi 416soclean,

    Thanks for reaching out to Jotform Support. I'm sorry you're having issues with your conditions. After checking the conditions, it seems you have selected a different field that's why it was not working properly. Let me show you how:

    1. While in Form Builder, click on the Carpet and Upholstery Cleaning total field.
    2. Click the Branches icon to open the Conditions.
    3. Hover your mouse to the condition and click the Pencil icon to edit.

    Show/Hide field based on selection from Multiple choice field Image 1 Screenshot 30

    4. Change the condition like below:

    Show/Hide field based on selection from Multiple choice field Image 2 Screenshot 41

    5. Once done, click Save button.

    That's it. Give it a try and let us know if you need any help.


  • 416soclean
    Replied on April 19, 2024 at 10:13 PM

    Hi Carrissa. I have done exactly that and for some reason it is still not working. That is how I had it originally and what you have suggested was already done. Is there another condition that is forcing the first field to be displayed, irrespective of what I have created with this specific condition? Any assistance would be appreciated.

  • 416soclean
    Replied on April 19, 2024 at 11:57 PM

    Hi Carrisa - wanted to add the following more information -

    1. When the form is first open and nothing is checked - the only field that should be visible is "Online Quote Totals"
    2. If ONLY Carpet Cleaning is selected, then the "Carpet Cleaning Total" label should ONLY be visible. "Online Quote Totals" label is still visible.
    3. If ONLY Upholstery Cleaning is selected, then the "Upholstery Cleaning Total" label should ONLY be visible. "Online Quote Totals" label is still visible.
    4. If BOTH "Carpet Cleaning" + "Upholstery Cleaning" is selected then - "Carpet Cleaning Total" label AND "Upholstery Cleaning Total" Label is HIDDEN and "Carpet & Upholstery Cleaning Total" label is VISIBLE

    I hope this clarifies the logic that I'm looking for.

    Any assistance would be greatly appreciated.

  • Frédéric JotForm Support
    Replied on April 20, 2024 at 2:54 AM

    Hi 416soclean,

    Thanks for getting back to us with these details. I'm sorry that you have some difficulties with this conditional logic. Indeed, it looks like not so intuitive in this case, so I will check it out with our developers.

    In the meantime, I found a workaround. The principle is to make all the conditions related to these fields based on a single value instead of the two checkboxes. Let me show you how to do it. 

    At first, set a calculation value to the two checkboxes Carpet Cleaning and Upholstery Cleaning.

    1. In Form Builder, go to the Build page.
    2. Select the checkbox for Carpet Cleaning, and click on its gear icon.
    3. In the right panel, go to the Options tab.
    4. Switch to ON the Calculation Values option.
    5. Set the Calculation Value for Carpet Cleaning to 1.Show/Hide field based on selection from Multiple choice field Image 1 Screenshot 130
    6. Following the same steps with the Upholstery Cleaning checkbox, set the Calculation Value of the Upholstery Cleaning to 2.Show/Hide field based on selection from Multiple choice field Image 2 Screenshot 141

    Once done,

    1. Add a Form Calculation widget below the checkboxes
    2. Click on its wandering icon.Show/Hide field based on selection from Multiple choice field Image 3 Screenshot 152
    3. Define the calculation to the sum of the Carpet Cleaning checkbox and Upholstery Cleaning checkbox, using the blue button Add field and the + sign from the pad.
    4. Click on Save.Show/Hide field based on selection from Multiple choice field Image 4 Screenshot 163
    5. To hide this field, click on its gear icon.
    6. Select the Advanced tab in the right panel
    7. Switch to ON the Hide Field option.Show/Hide field based on selection from Multiple choice field Image 5 Screenshot 174

    Now, disable or delete the conditions you defined to show/hide the three fields Carpet Cleaning Total, Upholstery Cleaning Total, and Carpet & Upholstery Cleaning Total.

    1. In Form Builder, go to the Settings page.
    2. In the left panel, select the Conditions tab.
    3. In the All fields menu on the right at the top of the list of conditions, select Checkbox Field (id3).
    4. Disable the first conditions related to the fields you want to show/hide.Show/Hide field based on selection from Multiple choice field Image 6 Screenshot 185

    And, finally, create four new conditions testing the value of the Form Calculation widget as the following:Show/Hide field based on selection from Multiple choice field Image 7 Screenshot 196

    The first being for value 0 (no checkbox selected):

    Show/Hide field based on selection from Multiple choice field Image 8 Screenshot 207

    The second one for value 1 (Carpet Cleaning only checked):

    Show/Hide field based on selection from Multiple choice field Image 9 Screenshot 218

    The third one for value 2 (Upholstery Cleaning only checked)

    Show/Hide field based on selection from Multiple choice field Image 10 Screenshot 229

    and the last for value 3 (both checkboxes selected):

    Show/Hide field based on selection from Multiple choice field Image 11 Screenshot 2310

    As a result, we get:

    Show/Hide field based on selection from Multiple choice field Image 12 Screenshot 2411

    Give it a try and let us know how it goes. 

 
Your Answer