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

Dear Monks, I'm making a Perl cgi script in which one has to select one of four radio buttons. Of those four selections, I want to provide the user with a scrollbox for one of them (and a textfield for another). But I can't seem to figure out how to modify my labels hash to do it. Here's the relevant code I have:
$labels{'1'} = 'Whole Genome'; $labels{'2'} = 'Whole Genome with MIPS Subsets'; $labels{'3'} = 'Specify a MIPS Subset'; #I need a scrollbox here $labels{'4'} = 'Custom Gene Subset'; # I need a textfield here. print $cgi->radiogroup(-name=>'sets', -values=>['1', '2', '3', '4'], - +default=>['1'], -labels=>\%labels);

Replies are listed 'Best First'.
Re: CGI: Scrollboxes in Radiobuttons
by Enlil (Parson) on Apr 30, 2003 at 00:50 UTC
    This should get you started:

    In order to get CGI to add the extra form fields in I needed to use autoEscape() so that the html would not be escaped (see autoEscape() in CGI docs).

    On a side note, I would personally use HTML::Template (or other templating system) so my I could better seperate code from HTML.

    -enlil