I wasn't able to get this to work before. http://drupal.org/node/1613458. I'm not seeing anything apparent in the issue queue. Did I miss it or is no one else in need of it?

Thanks,
Mickey

Comments

Bastlynn’s picture

One of my coworkers found a possible way around this: Instead of using the ID of the form to select on (which webform overrides), use attributes to set a class, and use jquery in your selector based on the class instead.

novid’s picture

I have this problem with fieldsets inside my webform and tried every posibile solution (as i know) but didn't work out. State system in webform works fine with checkbox, radio, textfield, textarea but not fieldset and i can't figure why. Also tried Bastlynn solution but didn't work either.

quicksketch’s picture

Category: feature » support
Status: Active » Fixed

I don't think Webform treats its forms specially in a way that would affect the #states property. It's true we set some IDs explicitly, to get Webform's own conditional systems working. However #states is just based off of selectors of any kind, it's not dependent upon a particular class, name, or ID. Just whichever property is rendered on the page #states should be able to use.

As to why fieldsets don't work with states... I don't know. I've never tried affecting a fieldset with #states before. But generally for hiding and showing, I'd recommend you use the 4.x conditional system instead, as it can deal with more complicated situations that #states does (at least for hiding and showing things).

I've updated #1613458: Form #states do not affect fieldsets from within $form["submitted"] with a comment saying that I think this is a core bug still. There are some other issues around fieldsets and #states that might provide some additional insight:

#767212: #states can't hide/show fieldsets
#1148950: Applying #states to a vertical tab does not update the vertical tabs menu

As a support request, I'm marking this fixed since I think that's all the information that is relevant to Webform.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.