Ryszard has asked for the wisdom of the Perl Monks concerning the following question:

I've RTFM and tried many difference combinations of things and for the life of me I cant get a link into the label of a checkbox_group using CGI.pm.

Essentially what i'm after is the a hyperlink next to the checkbox that will shoot off to help (or whatever), but if you tick the checkbox and hit submit, the value will be parsed for other processing...

Has anyone had any experience doing this?

Replies are listed 'Best First'.
Re: checkbox_group and a link
by hacker (Priest) on Jul 11, 2002 at 16:56 UTC
    You could always use the HTML -title attribute. Something like:
    my @title ({title=>'Option 1', value=>'Option 1 help'}, title=>'Option 2', value=>'Option 2 help'}, ... ); print checkbox_group({-name =>'my_name', -value =>['Option 1', 'Option 2'], -default =>'Option 1', -title =>"$title->{value}"} );
    I'll leave the exercise up to you as to how to get break the content out of @title, but that should be easy enough. I'm using this in a few places, though not with the same idea in mind.

    When you hover your mouse over the option, it will pop up the standard HTML 'tooltip' element. The added benefit of this is that you're not pushing the user off to another page or using popup windows or javascript, and it should work in text, WAP, and PDA browsers.

    Note, this may not be properly supported in all browsers.

Re: checkbox_group and a link
by fruiture (Curate) on Jul 11, 2002 at 17:19 UTC

    Well, basically: what CGI.pm calls "labels" in checkbox_group() is text that is directly written next to the checkbox, so not really a <label>. This label is automatically encoded as it seems.

    Looks like we'll have to 'reinvent':

    --
    http://fruiture.de
Re: checkbox_group and a link
by impossiblerobot (Deacon) on Jul 12, 2002 at 15:23 UTC