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.


  • Profile Image

    Are there show/hide conditions based on design-time data?

    Asked by DanBlum on June 07, 2017 at 05:59 PM

    Please help with a design question.

    I have a form that contains 20 drop down fields that correspond to the weeks of a camp that our parent/customers use to sign up for our sports  camp.  With the benefit of Jotform our camp has grown in popularity so that during the enrollment period, before and during the camp season,  some of these weeks fill up, and we want to manually over time hide a few of the 20 fields as the weeks fill up.

     

     I am looking for design suggestions that will allow me to easily hide some of these fields without deleting them. (We use the form as a model for the next camp season…so I don’t want to permanently  delete what’s there.)   I also don’t want to have to page through the form to find each of these fields because a person of lesser skill might be doing the hiding.

     

    I have in mind a design that I suspect is not directly supported by Jotform, but I’m not sure.     I am thinking that I want to  include conditional  logic to show/hide these fields based on the value in another (always hidden) single field that I base the  show/hide conditions on.  The twist is that I want the condition based on a field that I (the designer) fill in, not based on the data that a user inputs.  It is this twist that I wonder if it is supported.     So, if there are 20 fields that are identified as 1, 2,3,4, etc, I might have a  single control field that I input the  numbers I want hidden.  For example 245AD to respectively cause drop down number 2, 4, 5, 10 and 13 to be hidden ( "A" corresponds to 10 and "D" corresponds to 13).   That way, by tweaking one field, I can control what shows, reflecting what weeks are sold out.  

    (BTW: these drop down fields already have standard conditional logic that is based on user input in another field, so I don't want to interfere with that.)

     

    Is this somehow supported?    AND…perhaps there’s a totally different approach someone might suggest.

     

    Thanks.  

  • Profile Image
    JotForm Support

    Answered by Kevin_G on June 07, 2017 at 07:47 PM

    If I understood correctly you want to hide fields once all the available options are selected, if this is what you're referring to then you could add some conditions based on a long text entry field and hide the fields based on the information entered in this field. 

    For example, you add the long text entry to your form where you will enter the fields names you want to hide, you will need to add each name in different lines like default values, this way each time the form is loaded the fields will be hidden. 

    You can see an example on this form https://form.jotformpro.com/71577070220954 it hides text boxes and the long text entry field is visible, but it can be hidden too. If you type Field 2 or remove  the current value then all the text boxes will be displayed. 

    Here is also a guide that will help you doing it: How-to-Show-or-Hide-Fields-Base-on-User-s-Answer

    Now, if you are trying to hide certain options in a drop down, then this is not possible to do with conditions and there is not a widget that will allow you to do it; however, there are widgets that will allow you to set up an available quantity and once this is reached the option is automatically disabled. 

    The inventory widget is an example, it allows your users to select the desired amount for an option and once the available quantity is reached the option is disabled, this would not require to add any value on any other field or add conditions to your form. 

    Link to the widget: https://widgets.jotform.com/widget/inventory 

    You will also find a demo form there where you can see how it works. 

    This guide will help you adding the widget to your form: https://www.jotform.com/help/252-How-to-Add-a-Widget-to-your-Form 

    Hope this helps; however, if I did not understand correctly your question, please feel free to let us know, we will be glad to help you. 

  • Profile Image

    Answered by DanBlum on June 07, 2017 at 10:09 PM

    Thanks for the reply.  I don't think I got my question across. (My form already uses conditions to show or hide fields based on user input.  For example, a detail that I left out of my original post is that some of the drop down's are for members of our club and some are for non-members. This allows me to present different prices to the parents based on parents previously filling in a Member or Guest radio button. There are drop downs with prices intended for members and other drop downs with prices intended for non-members.)    BUT...forget all about this.  I described it here so that you'd know it's not what I am wanting.

    Let me rephrase what I AM looking for:

    I design my form perhaps 6 months ahead of the overall camp season. I have as many as 20 drop downs each representing a week that is being offered.   The options in the drop downs allow selection of which week days and whether AM, PM or both, and specific discounts (like sibling discount)  and the prices for each of these.   So, 3 months into this pre-camp period  lets say that camp week 2 fills up,  and therefore I want to accept no more  enrollments for week 2.   (There is no inventory associated with this.  "Filling up" is determined by me outside of Jotform.   What I do today is to go into the title of the drop down for that that week  (which might Say "Camp #2 - June 16-20") and  add the text:    "FULL - no enrollments being accepted".    

    This works mostly except that a parent can ignore the title and go ahead and enroll their child in that week....using the drop down.  This approach also requires the person doing this change to search through the overall form (with other complexities I've not detailed) to find the correct drop down(s) to change.  This person might not have the same skill level as me...the overall designer.  So I want something easier.  

    The most direct solution would be to actually delete the drop down for that week. (This has the same draw backs as mentioned in the paragraph above.) Then the parent would not even see the drop down and therefore could not enroll for that week.  

    However, I'm looking to do something different:    I want to create some single control element at the front of the form (that would not show on the form as displayed to the parent) that I can control which of the drop downs are shown or are hidden.   I would change this "single control element" in the Jotform design tool so that specific  intended drop downs are hidden.   I was suggesting something like the Conditions  facility that is already there....but that facility shows/hides fields based on our parents input (like I described in paragraph #1 above)   I want it to allow conditions based on some other design-time values that I (the form designer) change.  

    My original post suggested some "code" that I put someplace (I called it  a "single control element" above) that then is tested with Condition-like logic that is part of the 20 drop downs. 

    Is there some facility like this?  ...or some way to do what I m describing? 

    If you are a programmer, what I am suggestion is like conditional logic in a macro.  It allows changes to the code at compile time, not execution time.  

    Thanks for your patience.

     

    Dan

  • Profile Image
    JotForm Support

    Answered by Charlie on June 08, 2017 at 01:50 AM

    Hi,

    The issue that I am seeing here is that you are trying to edit or update a form that is in production manually. My colleague suggested the Inventory widget, this is not necessarily "inventory" but rather a special widget that allows you to set "available quantities" or "slots" for a specific option. 

    Below are some example widgets with the similar function:

    https://widgets.jotform.com/widget/inventory 

    https://widgets.jotform.com/widget/quantity_gift_registry 

    https://widgets.jotform.com/widget/gift_registry 

    https://widgets.jotform.com/widget/appointment_slots 

     

    However, you have an existing setup so replacing them with the said widgets above may not be the best solution, unless you are creating a new form with the similar format. 

    Now you would like to use a "conditional logic" to hide the drop down options when they are "full", is that correct? Yes that is possible, BUT you will also need to update the existing conditional logic that are related to those drop down options to avoid conditional conflict.

    Here's an example form based on how I understood your concern: https://form.jotformpro.com/71580787524970. You can clone my form by following this guide: https://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL. Here's how I did mine:

    1. First, the radio button will allow your user to choose a week and it will display a drop down field associated with it. 

     

    2. I will also setup "Text" fields which shows if the drop down field/week is full. 

    3. Now I will setup a text box field and name it as "Control Weeks". This will be the basis to show the warning "Text" AND disable the drop down field option. Note that we will NOT hide in this case, we will DISABLE. We can use HIDE though, but note that we already have conditional logic for showing/hiding the dropdown fields so it'll be a tricky setup for that case.

     

    4. Noticed that I am using the state "CONTAINS", this will allow the condition to read a part of the value in your text box, so let's say you input "1234" in the "Control Weeks" text box, because it CONTAINS "1", then the conditional logic will trigger. 

     

    5. Now you want to pre-fill the "Control Weeks" text box, just like you said, this change should be done before the form "compiles". So, what we do is we setup a "default" value, default meaning you have manually decided to categorized a week or a course to be "full". In my case, let's say I want to disable "Course 1 - Week 1", so I setup the default value to "1". It is also best to set it as "Read-only" and "Hide" it. 

     

     

    6. Result is, you can control which weeks to disable and show some static text message. The user cannot select an option in a disabled drop down field. 

     

    Now my setup is not that pretty, but the idea is there, you'll just need to do more tweaking and organization. 

    I hope that helps.

  • Profile Image

    Answered by DanBlum on June 08, 2017 at 10:02 AM

    Fantastic.  This is exactly what I was looking for.  Thank you for all the time you spent helping me.  The use of the default value bridges the form design-time setting versus  form execution time issue that I was having.  Also, the advice on disable v. hide likely saved  me from running into an issue  later.   

    Thanks again.

    Dan Blum 

    Pleased Jotform user since 2009