How to create complicated conditionally linked fields?

  • zmej
    Asked on October 18, 2017 at 1: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!

  • Nik_C
    Replied on October 18, 2017 at 2: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 Screenshot 10

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

    1508351010Screen Shot 2017 10 18 at 8 Screenshot 21

    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!



  • zmej
    Replied on October 18, 2017 at 2: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!

  • Nik_C
    Replied on October 18, 2017 at 3: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 Screenshot 10

    Or:

    1508353553Screen Shot 2017 10 18 at 9 Screenshot 21

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

    1508353673screencast Screenshot 32

    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!

  • zmej
    Replied on October 18, 2017 at 5:09 PM

    The task is to set laminating parameters in press sheet cost calculator. Press sheet cannot be laminated by different kinds of film on both sides.

    We can easily catch the bad combination by adding the calculation values of fields to some hidden field. Let's call it "indicator", for example.

    Let field1 will have the following calc.values: 0 for empty, 1 for A, 2 for B. Also let field2 will go for 0, 1 and 2 in the same order. So now if we sum the calc.values of both fields, 3 will indicate that we have an impossible combination. It's easier than making a bunch of IFs.

    But it seems that all the conditions are constantly checking and we cannot know which field had fired the "3" to an indicator. Or do we? Is there any nested conditions (maybe planned in future)?

    The best possible behaviour I think is forcing the user to.. but wait

    Thank you for using the right word in your reply. If we force the selection we will get in the bad loop. For example, user selection is "matte/matte". For some reason he changes his mind and trying to select "glossy/glossy" but the system will not let him do it. And the one possible solution to get "both glossy" selection is to go through "none/anything" or "anything/none" positions. Such behaviour is very uncomfortable and non-intuitive.

    Thank you again and sorry for entanglement :)

    Anyway, nested conditions is a must.

  • jonathan
    Replied on October 18, 2017 at 8: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 Screenshot 10


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



  • zmej
    Replied on October 19, 2017 at 4:04 AM

    I'm ok with two checkboxes and radiobuttons now: How to create complicated conditionally linked fields? Image 1 Screenshot 20

    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 :)

  • Welvin Support Team Lead
    Replied on October 19, 2017 at 10:00 AM

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

    How to create complicated conditionally linked fields? Image 1 Screenshot 30

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

    How to create complicated conditionally linked fields? Image 2 Screenshot 41

    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.