Attached is a patch to enable vertical tab support for webforms.
This patch has the following:
* Add a new checkbox to the fieldset component for using the fieldset as a vertical tab
* Adds a prerender function to the webform form.
* A prerender function, based on the vertical tabs prerender function.

CommentFileSizeAuthor
#5 VerticalTabs-1.patch2.31 KBthreewestwinds
webform.patch2.78 KBaaron1234nz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Version: 6.x-2.9 » 6.x-3.x-dev
Status: Needs review » Needs work

Interesting. I'll take a look at this, but I don't think this will be added to the 2.x version. I'll probably stabilize the 3.0 branch before adding more features there also.

lklimek’s picture

Hi,

I've created a similar functionality as a separated sandbox module for Drupal 7. It's converting all fieldsets into vertical tabs. You can find it here: http://drupal.org/sandbox/lklimek/1199990

Please consider adding this functionality to base webform version.

quicksketch’s picture

You can also create vertical tabs using http://drupal.org/project/ds. I'm not sure about incorporating vertical tabs directly into the project unless we can figure out a way to support them in Form Builder (http://drupal.org/project/form_builder). @aaron1234nz's original patch looks pretty good for a D6 version, but we'd also need to port to D7.

quicksketch’s picture

Status: Needs work » Closed (won't fix)

For the foreseeable future, I think Display Suite will be "official" solution here. I don't think we want to introduce the complexities of vertical tabs into the main project.

threewestwinds’s picture

Version: 6.x-3.x-dev » 7.x-4.x-dev
Status: Closed (won't fix) » Needs review
FileSize
2.31 KB

In D7 vertical tabs are very easy to add, since they're part of core, and I think they're better than page breaks in many situations. Not that we should remove pages - we should have both.

This patch is tested in IE 9, FF and Chrome, including conditionals both inside and outside the tabs.

quicksketch’s picture

Hi @threewestwinds, thanks for the patch. Even though this option is easy to add, I don't think it's a good fit for the Webform project. I know people use Webform for all sorts of things, but for the most part Webform is for forms provided to users who would need to fill out the whole form. Vertical tabs were introduced as a means to compact settings that users would skip frequently and leave the defaults most of the time (i.e. on the node form). I don't think that's the case for Webforms.

However as you demonstrated, implementation isn't difficult, so it could be provided as a stand-alone module using hook_webform_component_info() easily.

threewestwinds’s picture

We're using it more like an accordion - each tab as a step. We used to build our forms with pages, but both the end users and the form designers have found tabs to be much more intuitive - they can instantly see where they are, what's coming, and move around without waiting for a page re-load.

It's your call what goes in webforms vs. extension of course, but I think that the option is powerful enough for such a small code weight that it would be an improvement.

quicksketch’s picture

Yeah I see where you're coming from. Accordion forms are indeed common and might actually be a good fit for Webform, but Vertical Tabs aren't the same thing. Vertical tabs aren't quite the right solution, they're just a convenient one. I hate wasted work (especially when it comes in patch form), but I don't think it's a right fit for Webform. I'd encourage you to make a separate project (at least a sandbox) to hold the code as a stand-alone module. It definitely is a feature that some people may be looking for, and it's a light implementation compared to the massive Display Suite project.

quicksketch’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

There's a similar module in a sandbox over here: https://drupal.org/sandbox/lklimek/1199990, but personally I like the approach in this patch more. I don't think it ever made it into a stand-alone project. Per posts above, I don't think Vertical Tabs are a right fit for Webforms in general, so this won't be included in the main project.

ann b’s picture

@quicksketch, have you considered the following case? It has come up twice on my current project. We have webforms where the user can request one to five items using a single form, and he needs to provide details for each requested item. For example, if someone is doing research comparing two presidential campaigns, and wants to search the New York Times for articles on these campaigns, she can make the request on one form. She may only need two out of the five items for her request (year x and year y). It would be nice to hide the other three item sections. What do you think?

waqarit’s picture

I have applied these patches and also found a new component named as Tab Group. But in form it shows nothing. Then I inspect the element through firebug but found element containing vertical tab classes. What could be the problem???
As you have mentioned in first point

Add a new checkbox to the fieldset component for using the fieldset as a vertical tab

.
But I found no checkbox along with fieldset containing any information about vertical tab.