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

    Regarding the Yes or No Button

    Asked by toclimateres on November 15, 2016 at 05:03 PM

    Scenario:

    X is a drop down menu with 9 different options.

    Y is a YES or NO Button. If Y=YES, then Y = 0; if Y=NO, then Y will take a some value based on the 9 different options of X. 

    Question:

    I just want to make sure there is no way to get around using 9 DIFFERENT if-statements for scenario, meaning that I can not combine them into 1 if-statement. I am asking because I want to have maybe 10 different YES or NO Buttons, which means I will probably end up with 90 different if-statements.

     

    Regards,
    Jacob

  • Profile Image
    JotForm Support

    Answered by BDAVID on November 15, 2016 at 06:36 PM

    Not sure if I understood what you mean, but here is my example based on the logic you have provided:

    1) If you have a drop down field with 9 options, assign a value to each option: https://www.jotform.com/help/301-How-to-Assign-Calculation-Value 

    2) Then I guess you will be using a radio button for the "yes or no" question.

    3) To obtain the result add a Form Calculation field:

    4) Create the following conditions:

    Result: https://form.jotform.com/63196600180956 

    So, I believe it will only take two conditions based on the scenario you described. Let us know if you need more help.

  • Profile Image

    Answered by toclimateres on November 16, 2016 at 10:14 AM

    Hi BDAVID, thanks for the speedy reply! Let me try again.

    Scenario:

    X is a drop down menu with 4 different options.

    Y and Z are YES or NO Buttons.


    If Y=YES, then Calc_Y = 0, regardless of the value of X

    If Y=NO and X=Option1, then Calc_Y = 1

    If Y=NO and X=Option2, then Calc_Y = 2

    If Y=NO and X=Option3, then Calc_Y = 3

    If Y=NO and X=Option4, then Calc_Y = 3

    If Z=YES, then Calc_Z = 0, regardless of the value of X

    If Z=NO and X=Option1, then Calc_Z = 3

    If Z=NO and X=Option2, then Calc_Z = 7

    If Z=NO and X=Option3, then Calc_Z = 6

    If Z=NO and X=Option3, then Calc_Z = 8

    Like the following:


    I just want to make sure there is no way to get around of using 8 (4*2=8) DIFFERENT if-statements for the scenario. Because I want to have 10 YES-or-NO buttons, which means I will end up having 40 if-statements. 

     

     

  • Profile Image
    JotForm Support

    Answered by david on November 16, 2016 at 11:33 AM

    From the looks of your setup, it would require a one condition per output.  I do not see a way to do this with calculations alone that would reduce the number of statements that would need to be made.

  • Profile Image

    Answered by toclimateres on November 16, 2016 at 07:17 PM

    Okay, thank you David!