in reply to Creating HTML radio button group with text field
I didn't like having to turn off autoEscape() and explicitly escape the other entries, so I was looking for a cleaner solution -- but it looks like that's as good as it gets (with CGI.pm, at least).my @values = qw( a b c d ); my %labels = ( a => 'Friend', b => 'Magazine (please specify:)', c => 'Internet', d => 'Other', ); $labels{$_} = $cgi->escapeHTML($labels{$_}) for keys %labels; $labels{b} .= $cgi->textfield(-name => 'magname'); print $cgi->start_form(); $cgi->autoEscape(0); print $cgi->radio_group(-name => 'question', -values => \@values, -linebreak => 'true', -labels => \%labels); $cgi->autoEscape(1); print $cgi->endform;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Creating HTML radio button group with text field
by Anonymous Monk on Sep 09, 2009 at 19:39 UTC |