How can I conditionally hide/show fields based on a calculated range of checkboxes?

  • carlosfarnesi
    Asked on January 6, 2017 at 2:00 PM

    Hello, how are you!? Hope so!

    See if they can help me in the development of a form of which as the user selects his or her points and according to the sum of these points, we present different answers.

    Here is an example page: http://www.clinicahalitus.com.br/teste-o-seu-halito.

    Each selection has a value. When adding all the selections made by the user, we must present a message if:

    - Total sum is up to 10, show message 1

    - Total sum to be up to 11 to 20, show message 2

    - Total sum to be up to 21 to 30, show message 3 ... 

    We can not show the sum and total of these points. Only the final message.

    Is this possible? Can you help me?

     

    Thank you very much

    Carlos

  • Support_Management Jotform Support
    Replied on January 6, 2017 at 3:54 PM

    I checked that page http://www.clinicahalitus.com.br/teste-o-seu-halito but failed to find any JotForm form embedded on it.

    I'll just assume you're working on this form https://www.jotform.com/70044369019959

    I noticed you have a set of Checkboxes along with a Number Field that was supposed to fetch the total based on the selected options on the checkbox.

    However,  you setup your conditions like so:

    How can I conditionally hide/show fields based on a calculated range of checkboxes? Image 1 Screenshot 50

    Please delete those 2 conditions. Keep in mind that that's not how conditions and calculations work. Before you proceed, I strongly urge you to refer to the following guides to learn more on how to use these:

    Conditions: Smart-Forms-Using-Conditional-Logic

    Calculation: How-to-Perform-Calculation-in-the-Form

    Now, to get the total calculated value of the selected options on the checkbox, all you have to do is setup one condition like below:

    How can I conditionally hide/show fields based on a calculated range of checkboxes? Image 2 Screenshot 61

    This means that IF Selecione as opções do teste IS FILLED then copy its value to Resultato.

    To add a message that will appear conditionally, depending on the total value, just add 3 Text Fields. Since I don't know what the exact message is, I'll just use your post as an example:

    How can I conditionally hide/show fields based on a calculated range of checkboxes? Image 3 Screenshot 72

    And lastly, just setup the conditions to take care of that:

    How can I conditionally hide/show fields based on a calculated range of checkboxes? Image 4 Screenshot 83

    Here's the completed form: https://form.jotform.com/70055663924963 I purposely didn't hide the Resultato field for testing purposes.

    I recommend you clone it, here's how, if you want to have a closer look. Give it a spin and let us know if you'd need more help.

  • Support_Management Jotform Support
    Replied on January 6, 2017 at 3:59 PM

    UPDATE:

    Just some minor changes to the conditions. Please refer to the image below:

    How can I conditionally hide/show fields based on a calculated range of checkboxes? Image 1 Screenshot 20

  • carlosfarnesi
    Replied on January 9, 2017 at 11:14 AM

    Hello Jim_R, thanks for your great help! I hope I'm on the right track! When possible, could I look again at the adjustments I made and point out where I'm going wrong? I think it's a simple thing to solve. Thank you very much for your attention.

    Form link: https://form.jotform.com/70044369019959

  • BJoanna
    Replied on January 9, 2017 at 1:10 PM

    I have inspected your form and you are passing value from calculation to text field. For text field it is not possible to use Greater or Less inside of conditional logic.

    First you need to replace text field with number field or with Form Calculation widget

    How to Perform Form Calculation Using a Widget

    After that cahnge your conditions and set them like this. 

    How can I conditionally hide/show fields based on a calculated range of checkboxes? Image 1 Screenshot 20

    Here is my form: https://form.jotform.com/70084729049966 

    Feel free to clone it

    You can also clone the form that my colleague Jim_R provided you. 

    https://form.jotform.com/70055663924963 

    Hope this will help. Let us know if you need further assistance. 

  • carlosfarnesi
    Replied on January 9, 2017 at 5:04 PM

    Perfect! Thank you very much.