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

    Help with creating this form

    Asked by melodicsounds on February 11, 2016 at 01:50 AM

    In the past days I've been trying to recreate this form: https://www.homework-desk.com/order/ as simple as it looks its has been a pain. As you can see all the form depends and changes depending on the first drop-down which is Type of Document. Depending on what you choose there some restrictions will apply that will hide or show some fields. I have some problems that I've been facing. So far I've managed to re-create all that exact form just to one scenario, for example: Coursework (see in the link) in type of document. Everything works fine and the calculations with "value" preferences works fine! It changes depending on your selection on several drop downs. THE PROBLEM starts here:

     

    1.) When you add a second, third and many other scenarios to the first menu "Type of document" for instance: Math problems, Essays, Powerpoint presentations some of the problems that I've been facing are:

     i.) My calculation field works with a simple formula: (xfield*yfield)+zfield (calculates the total of your homework) this is for 1st scenario Coursework. But what happends when in second scenario Math problems theres more variables and my formula for the total calculation will be: (xfield*yfield)+zfield+wfield+Rfield... If I add this new wfield and rfield the formula won't work because in scenario 1 Coursework, those variables are not displayed so user can't choose them since those variables are only chosen in dropdowns in scenario Math problems. Its hard to explain but did you understood?

     ii.) Again starting from the main question: Type of document those scenarios (Coursework, Math Problems, Essay etc...) share some dropdowns for example: Date of Delivery, Spacing, Number of Pages...The problem here is that if user choses all this options from this menus from scenario 1 Coursework but for some reason he wants to changes to scenario 3 or 4 lets say Essay, all the elements that he already choosed will stay in there. I need that everytime that user changes first questions Type of document all the fields gets reseted because the price right now stays as the first selection but doesn't update neither the price or the selection while changing from the first question.

      iii.) In some drop downs I need to restrict some options depending on the prior selection. For example lets say we have dropdown 1 with options (1,2,3,4,5) and dropdown 2 with options (A,B,C,D,E,F,G). I need to achieve this: If user chooses 1 on dropdown1 display on dropdown2 A,B,C,D if user chooses 2 display display A,B,C if user chooses 3 display A,B etc... Can't manage to do this right now.

     iv.) For calculating the total of a scenario as I al ready said it depends on some variables. For this example lets compare 2 scenarios: Courseworks vs Book Report. In Coursework my calculation field (which is the total to be paid) is calculated with (spacing*number of pages)+date of delivery but in Book Report my total should be calculated (spacing+number of pages)+date of delivery+number of pages we need to read as you can see 1 variable is added in this scenario. The PROBLEM starts here: So this 2 scenarios share those dropdowns: Spacing, Numbers of pages, and Date of delivery BUT only Book Report has option for "number of pages we need to read", so the problem is a logic problem lets say this is how it looks the logic on scenario Coursework:

    1. Type of Document = Coursework.

    2. Date of Delivery =  10 days.

    3. Spacing= double

    4. Number of pages = 5 pages.

    Total = (2*5)+10 

     

    For Scenario Book Report:

    1. Type of Document = Book Report.

    2. Date of Delivery =  10 days.

    3*.Number of pages we need to read= 5 pages.

    4. Spacing= double

    5. Number of pages = 5 pages.

    Total= (2*5)+10+5

     

    The LOGIC problem here starts when "Number of pages" needs to be after "Date of Delivery"... but "Date of Delivery" has restriction of: If "Date of Delivery" contains then show "spacing" (this was done for scenario 1 since you don't ask "number of pages we need to read" in that scenario). So how to achieve that "Date of Delivery"(remember it is shared by all scenarios) goes to "number of pages we need to read" and then goes to spacing only for scenario Book Report?.

    NOTE: in this iv) you can see a little more clear what we are talking about i.) How in different scenarios some variables affect the final price but those variables if you add them ALL to the formula it won't show because depends on the scenario you are, the variables you will use on that formula. In this example we saw that "Number of pages we need to read" was added to the formula in scenario 2 but not for scenario 1. 

     

    Help with this, thank you guys.

    Page URL:
    https://www.homework-desk.com/order/

    creating problem calculations variables create
  • Profile Image

    Answered by melodicsounds on February 11, 2016 at 02:16 AM

    Maybe this can me solved really easily if you had the option to join different forms. I can make each scenario with its correspondant variables and calculations and that the first question "Type of document" opens this different form. Is this possible? So if you choose in type of document: Coursework it opens FormA if you choosed Book Report opens FormB that way I can add diferent fields, different calculations for each one. 
  • Profile Image
    JotForm Support

    Answered by Mike_G on February 11, 2016 at 01:42 PM

    I created sample form(s) with only two options for the "Type of Document" drop-down field base in your example above. I'll try to answer each of the conflicts you're encountering one by one in segments. Please note that some of your required functions may not still work on other forms especially the first ones, to avoid confusion with the explanation.

    Let's start! 

     i.) My calculation field works with a simple formula: (xfield*yfield)+zfield (calculates the total of your homework) this is for 1st scenario Coursework. But what happends when in second scenario Math problems theres more variables and my formula for the total calculation will be: (xfield*yfield)+zfield+wfield+Rfield... If I add this new wfield and rfield the formula won't work because in scenario 1 Coursework, those variables are not displayed so user can't choose them since those variables are only chosen in dropdowns in scenario Math problems. Its hard to explain but did you understood?

    For this scenario, I have created this form: https://form.jotform.com/60413369172958

    The form above is consist of 5 dropdown fields: Type of Document, Date of Delivery, Spacing, Number of pages, and Number of pages we need to read. Aside from those fields, I also added a textbox field for the total.

    Type of Document field has two options, Coursework and Book Report.

    Date of Delivery field has 10, 7, 4, and 3 Days options in it.

    The Number of pages field has options from 1 to 10, as well as Number of pages we need to read field.

    The Spacing field also has two options, Single and Double.

    Please be noted that this form will only show you how you can separate the computation for the two options on Type of Documents field.

    Since we only have two options for Type of Document field for now, we only need to create two conditions.

    One thing that you need to remember if you'll be using drop-down fields, radio button fields, and checkbox fields options for your calculation is you need to set a Calculation Value for each option first. In order for you to do that, you may refer to this guide: How-to-Assign-Calculation-Value

    Please note that in addition to the calculation values of each option, you need to have a "0" value on the Calculation Values for the first option which is the blank/empty option.

    Once you've done that, you can proceed to create the first condition.

    First condition: If Coursework is selected from the Type of Document field, multiply the value of Spacing field to the value of Number of pages field and then add the value of Date of Delivery field after to the Total field.

    Second condition: If Book Report is selected from the Type of Document field, multiply the value of Spacing field to the value of Number of pages field and then add the values of Date of Delivery field and Number of pages we need to read field.

    Here's how it works:

     ii.) Again starting from the main question: Type of document those scenarios (Coursework, Math Problems, Essay etc...) share some dropdowns for example: Date of Delivery, Spacing, Number of Pages...The problem here is that if user choses all this options from this menus from scenario 1 Coursework but for some reason he wants to changes to scenario 3 or 4 lets say Essay, all the elements that he already choosed will stay in there. I need that everytime that user changes first questions Type of document all the fields gets reseted because the price right now stays as the first selection but doesn't update neither the price or the selection while changing from the first question.

    I have created a new form for this which is base on the form I have created above. https://form.jotform.com/60414329969969

    This can be accomplished by adding a Hidden Box field on your form with an empty value and with the help of conditions as well.

    Adding the Hidden Box field: This field will not show on your form.

    Once you've added the field, go to its properties and check the Default Value option. You can leave it as "Click to Edit" (default) or you can put " " (single space) in it.

    Then after that, create conditions that will pass the value of Empty Fields field to the other fields that need to be empty if Type of Document field is filled. You need to make separate conditions for each field that you want to be empty if the value for Type of Document is changed.

    Here's how it works:

      iii.) In some drop downs I need to restrict some options depending on the prior selection. For example lets say we have dropdown 1 with options (1,2,3,4,5) and dropdown 2 with options (A,B,C,D,E,F,G). I need to achieve this: If user chooses 1 on dropdown1 display on dropdown2 A,B,C,D if user chooses 2 display display A,B,C if user chooses 3 display A,B etc... Can't manage to do this right now.

    Actually, we don't have a condition for removing/adding options from a drop-down field depending on other fields value. But, there is a workaround for that.

    This would require you to create multiple drop-down fields of the same field name(Dropdown 2) but has different options in it.

    Here's a sample form for that: https://form.jotform.com/60414580123950

    You can use the duplicate field option from properties of the Dropdown 2 to create multiple dropdown fields. This would be easy since the options you added on the first one you created are also being copied.

    On the screenshot below, you will notice that I updated the field labels, please be noted that I only did that so it would not create confusion when I'm creating the conditions need for the form to work.

    Update the options on each Dropdown 2, base on your requirement.

    After that, create a condition that will show the corresponding Dropdown 2 depending on the selected option on Dropdown 1.

    After creating the conditions, you can now rename all the Dropdown 2 fields so they will have the same name which is just "Dropdown 2". The condition you have created should not be affected by this changes.

    Here's how it works after.

    Now, you might ask, what if the one filling up your form changes his/her mind after selecting 1 from Dropdown 1 and selected B for Dropdown 2? Will the selected option for Dropdown 2 if 1 is selected from Dropdown 1 remain if it is hidden after another option is reselected from Dropdown 1? The answer is, yes. That is why you need to perform the same condition applied in my example above for your second question. You can create a condition that if Dropdown 1 is filled, put Empty Fields field value to Dropdown 2. Please note that you need to do this condition for all the other Dropdown 2 fields on the form.

     iv.) For calculating the total of a scenario as I already said it depends on some variables. For this example lets compare 2 scenarios: Courseworks vs Book Report. In Coursework my calculation field (which is the total to be paid) is calculated with (spacing*number of pages)+date of delivery but in Book Report my total should be calculated (spacing+number of pages)+date of delivery+number of pages we need to read as you can see 1 variable is added in this scenario. The PROBLEM starts here: So this 2 scenarios share those dropdowns: Spacing, Numbers of pages, and Date of delivery BUT only Book Report has option for "number of pages we need to read", so the problem is a logic problem lets say this is how it looks the logic on scenario Coursework:

    The LOGIC problem here starts when "Number of pages" needs to be after "Date of Delivery"... but "Date of Delivery" has restriction of: If "Date of Delivery" contains then show "spacing" (this was done for scenario 1 since you don't ask "number of pages we need to read" in that scenario). So how to achieve that "Date of Delivery"(remember it is shared by all scenarios) goes to "number of pages we need to read" and then goes to spacing only for scenario Book Report?.

    For your fourth concern, I have used the workaround applied for your questions number 1 and 2 above.

    Here's the form I have created for this question: https://form.jotform.com/60414974564966

    First of, to my understanding, you would like to only show the other fields depending on the fields filled before them. If I understood you correctly, you would like to have your form show fields one at a time depending on your selections. For example, if you select Book Report for Type of Document field, you would like the field Date of Delivery to show first. Then, after selecting an option for the  Date of Delivery field, since you have selected Book Report for Type of Document field, you would like to show Number of pages we need to read field and select an option for that field first before showing the Spacing field and Number of pages field, is that correct?

    If that's the case, we need to enhance our conditions.

    First, we need to make sure that when Type of Document field is filled then, show Date of Delivery field.

    After that create a condition that if Date of Delivery is filled and Type of Document is equal to Book Report then, show Number of pages we need to read field.

    Make sure you set the conditions to If "ALL" rules are matched and not "ANY".

    The next condition that we need to create is, if Type of Document is equal to Book Report and Date of Delivery field and Number of pages we need to read field are both filled, show Spacing field and Number of pages field.

    Make sure you set the conditions to If "ALL" rules are matched and not "ANY".

    As for the option Coursework of theType of Document field, we need to create another condition for that, so when it is selected and Date of Delivery is filled, it should show the Spacing field and Number of pages field only.

    Here's how it works after:

    I hope this helps. Let us know if you need any clarifications or if you have questions about the instructions/explanation given above.

    With regards to your other concern,

    Maybe this can me solved really easily if you had the option to join different forms. I can make each scenario with its correspondant variables and calculations and that the first question "Type of document" opens this different form. Is this possible? So if you choose in type of document: Coursework it opens FormA if you choosed Book Report opens FormB that way I can add diferent fields, different calculations for each one. 

    I have moved it to a new thread which you can follow by clicking this link.

    Thank you.

  • Profile Image

    Answered by melodicsounds on February 11, 2016 at 03:17 PM

    Mike I wanna thank you for the effort and time you dedicated to this. I believe you really answered all my questions. Again, thank you so much for your time. I will wait for the last quetion you moved to be answered, I believe this will be easier (if its possible) instead of adding all the restrictions to 1 form. 

  • Profile Image
    JotForm Support

    Answered by Kevin_G on February 11, 2016 at 08:27 PM

    Great to know the workaround provided by my colleague worked.

    I see there is a reply on the other thread, one of our colleagues will assist you soon.

    Do let us know if you need further assistance, we will be glad to assist you.