What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
Input Table: How to set up conditions based on options selected in the table?Asked by purecoldpress on March 01, 2017 at 04:28 PM
I've managed to get conditionals to work if any checkbox in Column C is selected, but when I try to create a second conditional that gets triggered when any checkbox in Column A is selected, it refuses to work. I am doing the exact same thing for Column A that I did for Column C, so I don't understand why one works and the other does not. Am I doing something wrong in the construction of my conditionals?
Here are screenshots of my conditionals. I have fields "Custom Size" and "TEST" hidden and I want "Custom Size" to appear only if "Custom" column is chosen and I want "TEST" to appear only if "Small" column is chosen.
As soon as I test my form, I can tell something is wrong because the hidden field "TEST" is showing even if there is nothing selected in the table.
However, if I select something in the "Custom" Column, "Custom Size" field will pop up. Which is exactly what I want to happen.
I can't figure out why one of my conditionals works perfectly while the other doesn't work at all when I implemented them both in exactly the same way. Any suggested solutions?
Also, am I constructing my conditionals wrongly? I couldn't find much information on how to properly write conditionals for table inputs. Is there a way to say if the checkbox in the "Salad Only" row and "Small" column is selected, show field X. Then, if the checkbox in the "Salad Only" row and "Medium" column is selected, show a different field Y. Is this possible?
I have checked the conditions you show in your screenshots and I can see they're working on my end, do note that the value in the "If" statement needs to be exactly the same as the one in the input table.
Here's a screen-cast about how it works on my end:
This is how I have set up my conditions:
But do note that setting up conditions in this way will trigger it no matter the row where the option is selected, for example, the selected option could be "Salad Only" and "Small", so it means the condition will trigger only once and you cannot set up conditions per row.
However, a workaround would be to use the Form Calculation widget to capture the selected value of each row.
Once the widget has been added you can include the options in a row of the input table, here's a screen-cast for further reference:
The values will be added as numbers by default, but you can click on them to convert the result to text, you can also separate each value with a comma or space if needed:
You must do this if you need to copy the string selected in the matrix field, otherwise you will get only 0 values.
Now, when you select a value or all the values in the selected row they will be added to the calculation widget, this will help you to know the selected option/options in a single row so you can set conditions based on this, depending on the selected option in the first row show some fields and so on.
Here's my sample form where you can see the conditions working as well as the calculation widget: https://form.jotform.com/70597459745978
This guide will help you to clone it if you want: https://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL
If you have any question, please let us know.
Thanks for your quick response! The Form Calculation Widget was the exact solution I was looking for.
I tried using it just now, though, and for some reason when I click on "Add Field" and select my table, it shows me all the rows but none of the columns. In place of the columns it says "Use?". Refer to screenshot below. Is there something else I must do?
Nevermind, I figured it out. I had changed the format of my table to radio buttons. When I changed it back to checkboxes I got the desired result.
On behalf of my colleague, you are welcome. I am glad to know that your issue is resolved and your form is working as expected.
Do get back to us if you have any questions.