I am using webform heavily on a site I am building, but have hit a massive hurdle.
The site owner wants help text to appear at the end of each checkbox option.

For Example:

Option 1 [i]
Option 2 [i]

The user can then click on the '[i]' at the end of the checkbox tect to display a popup with a description of that option.
Any help greatly appreciated...

CommentFileSizeAuthor
#5 webform-form.tpl_.php_.txt6.09 KBvernond
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vernond’s picture

That is waaaaaayyyyy outside of Webform. You're going to want to look into hook_form_alter and jquery (or just standard/basic javascripting) for that kind of thing.

digiRich’s picture

Doh!
I was hoping that wouldn't be the case.
Its at times like this I wish I hadn't built 6 pages of long checkbox webforms, and done it with plain old php from the start.
Rethink methink, but thanks.

vernond’s picture

:-) In my limited experience it's easier to do via the Drupal and jquery frameworks than hand-coding everything from scratch. I even managed once to get it as far the popup's appearing on mouseover rather than showing a div with a click. It can be quite effective (although, in my innocence at the time, I did it without the benefit of advanced libraries like jquery).

Take a peek at happens when you hover over the text next to the checkboxes here: http://www.redballoon.biz/mg/index.php

digiRich’s picture

That is pretty much what I need. I just hope that this will be interated in to the next release of webform (or just more flexibility to add code).
Can you point me in the right 'hook_form_alter' direction.

Thanks for your advice...

vernond’s picture

FileSize
6.09 KB

I blush as I confess that I didn't do that "the right way". I'm attaching the butchered webform-form.tpl.php (remove the .txt from filename) for you to play with as you see fit. The additional help.css file which does most of the magic you can grab from the site above.

Basically what I did was manipulate the Drupal rendered HTML as a string prior to outputting it to the client browser. There are better/cleverer ways, as I said, and I'm not entirely sure just at this minute exactly how it would work using the right hook... Good luck though!

digiRich’s picture

Thanks for that. Much appreciated.
I'll let you know how I get on:)

DanChadwick’s picture

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

There won't be further feature development in the X.x-3.x branches.