I'm working on a webform with nested conditional fields, but can't get the nested conditionals to function correctly. I've attached a node export below.

The conditional fields "Show More 1-4" should all nest under each other, but I can't determine what might be causing the error here. Any help or direction would be greatly appreciated. Thanks!

CommentFileSizeAuthor
#3 webform_conditional-fix_for_trigger_field_not_in_javascript-1463032-3.patch757 bytestedbow
#2 nested-fields-issue-example.txt10.16 KBAnonymous (not verified)
nested-fields-issue-example.txt10.3 KBAnonymous (not verified)

Comments

tedbow’s picture

Status: Active » Postponed (maintainer needs more info)

1 problem I see right off is that your 2 fieldsets have the same form key. I won't think webform would let you do this b/c neither feildset is nested. Please make sure each component has a different form key.

Also for testing purposes can you make sure that each of your component has a different label. It makes it confusing to know which component is actually being shown or hidden.

Please export the webform again with these changes and I will take another look.

thanks

Anonymous’s picture

StatusFileSize
new10.16 KB

Sorry about that - I've reformatted and exported below. The fieldsets beneath each select option are conditionally showing just as they should, but the second conditional field won't show/hide based on the first field.

Thanks so much for your help

tedbow’s picture

Version: 7.x-1.0-alpha2 » 7.x-1.x-dev
Category: support » bug
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new757 bytes

I am changing this to a bug b/c I think I found the problem. I am attaching a patch. If you are able to please try this patch against the dev version and see if this fixes it for you.

It fixed it for me. If anyone else wants to try this patch on any other form I would appreciate it. I want to make sure it doesn't cause any other problems.

Thanks

Anonymous’s picture

I was able to test this on 2 forms (including the one above) and it fixed the issue for me on both.

Thanks!

tedbow’s picture

@ rclations, thats great to hear. Also if you have any other Webforms that you are working with please test them and make sure it doesn't introduce any unrelated problems. Thanks!

dragon123’s picture

Thank you very much tedbow it worked for me for webform_conditional-6.x-1.1.
And up-till now doesn't seem to be any problem.

Anonymous’s picture

#3 is fine for me in webform_conditional-6.x-1.1, too. I realise this issue is for 7.x-1.x-dev, but the code seems to be the same. Could this be committed and backported?

socialnicheguru’s picture

Edit: Sorry. I used the wrong version. can't say if it applies or not to 1.x

patch in 3 no longer applies

rooby’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Issue summary: View changes

The patch no longer applies because this has already been committed to d7.

It has not been added to d6 yet though.

Someone mentioned the patch also works for d6 so leaving status at needs review.