How to create complicated conditionally linked fields?

  • Profile Image
    zmej
    Asked on October 18, 2017 at 01:08 PM

    I would like to have two selections (dropdowns, radiobuttons or checkboxes), each with three possible states: empty, A and B. If both of them are not empty, their state must be the same.

     

    For example.

    Ok choices are: empty/empty, A/A, B/B, empty/A, empty/B, A/empty and B/empty.

    Prohibited ones are: A/B and B/A.

     

    Is there any way to do this? Thanks!

  • Profile Image
    Nik_C
    Answered on October 18, 2017 at 02:24 PM

    If you meant to automatically exclude options that are not allowed from the certain field, I'm afraid that is not possible to do that.

    As a workaround, I used two radio buttons and two Text fields that will show the message if the selection is ok or not:

    1508350937Screen Shot 2017-10-18 at 8.24

    Then I created conditions that will show/hide those messages based on combinations you provided:

    1508351010Screen Shot 2017-10-18 at 8.24

    Also, if the combination is not good the submit button is hidden.

    You can check my test form: https://form.jotform.com/72905099751970

    Not sure if that could work for you?

    Please let us know.

    Thank you!



  • Profile Image
    zmej
    Answered on October 18, 2017 at 02:41 PM

    Thank you for such a fast answer!

    Well, that's a crude solution but I can use it in my prototype. Although the user of the form will be a little frustrated to read the commands issued by interface. You know, as interface begins to dictate how the user have to behave, it's a bad interface. :)

    Much clever is to change the form field in the moment the linked one changes. In other words, if both fields are not empty, one should follow the changes that are made in another field.

    Is it possible? Thanks in advance!

  • Profile Image
    Nik_C
    Answered on October 18, 2017 at 03:18 PM

    Thank you for additional explanation.

    I agree that the above solution is robust, but that was since I thought you need to fill both fields.

    If you need to fill the first field and make the second field follow then that is possible by using conditions. For example, conditions like this can be created:

    1508353527Screen Shot 2017-10-18 at 9.08

    Or:

    1508353553Screen Shot 2017-10-18 at 9.08

    So when Empty, A or B is selected it will reflect in the second one as well:

    1508353673screencast.gif

    But, the issue here is to cover these combinations: empty/A, empty/B, A/empty and B/empty.

    Since you can not set more than one with the above condition. 

    On the other hand, I'm not sure what is the workflow of your form but if you could shed some light on it, we could maybe find some workaround that will force the selection.

    We'll wait for your response.

    Thank you!

  • Profile Image
    jonathan
    Answered on October 18, 2017 at 08:22 PM

    Is there any nested conditions (maybe planned in future)?

    Actually nested conditions is possible already. See image below for example.

    1508372487zzz 2017-10-19 08.19.46.png


    Let us know if this is not what you were looking for.



  • Profile Image
    zmej
    Answered on October 19, 2017 at 04:04 AM

    I'm ok with two checkboxes and radiobuttons now: 

    Well, the things you're talking about are "if A and B then" and "if A or B then" conditions. How can I do mixed "and" and "or" conditions ("if (A and B) or (C and D) then")?

    Also I'm feeling confused without "else" construction. It seems like we have to create two similar IFs to do this: "if A then B else C":

    if A then B + if not A then C

    Seems complicated a little :)

  • Profile Image
    Welvin
    Answered on October 19, 2017 at 10:00 AM

    "and" means both fields should match. For this, you should setup the condition as IF ALL.

    "or" means any of the two fields. For this, you should setup the condition as IF ANY.

    I think you are just confused with how the condition works, but based on the previous discussions, I'm sure your conditions are possible to achieve. 

    We can help you set this up in the form, just please let us know here.