I've created a multi-page webform where the user first chooses sports that they are interested in from a set of checkboxes (component name is "Sport"). In a later step, I've got multiple sets of radio buttons that are meant to gauge their interest level in the sports that they chose. So, as an example, let's say that the user chooses "tennis" from the first set of checkboxes. I'm wanting them to then only see the radio button set for the tennis question if "tennis" was previously selected. For the radio button component, I have:
Conditional rules:
• Sport
• is one of
• tennis
However, when I begin filling out the form, the later question appears regardless of whether or not the "tennis" checkbox was checked in the initial "Sport" question. Any ideas what I might be doing wrong?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | webform-6.x-3.0-beta5-multiple-conditional.patch | 585 bytes | attheshow |
Comments
Comment #1
attheshow commentedStrange, this issue doesn't seem to happen on a form with a single page break. It works fine there. I'm going to try rebuilding my form and see if I can discover at what point the conditionals stop working.
Comment #2
attheshow commentedOk, I think I've narrowed it down. It looks like the conditionals work unless the "multiple" option is used on a parent select component.
In my example above, the "Sport" component is the parent and it's a set of checkboxes (a.k.a. multiple).
I think this is a bug, so I'm going to mark it as such.
Comment #3
quicksketchThanks attheshow, I think there's a good probability you are correct. I think our comparison is s straight value check, since checkboxes send an array of values instead of a string, it doesn't compare correctly.
Comment #4
attheshow commentedOk, I think I found the bug. This got it working for me. (Patch attached to this comment)
Comment #5
machete1 commentedOn a fresh install of beta 5 this patch worked for me as well.
Comment #6
quicksketchThanks guys, I'll give this a review when things calm down at work.
Comment #7
quicksketchThanks attheshow, you were spot-on. Tested the patch and it works perfectly with both checkboxes and multivalue select lists. Committed to 3.x branches.