http://qs321.pair.com?node_id=383186

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

Morning fellow monks,

Im having troubles with displaying the formatting of the labels in a checkbox_group.

Basically what im trying to achieve is to create a horizontal list of check boxes, the labels for these checkboxes will vary and so must the formatting.

As shown in the code below...

... @the_list = ("1","2","3","4"); foreach $bit (@the_list) { $the_labels{$bit} = $bit . "label1" . "description"; } return (table({-border=>'0',-width=>'100%'}, start_form({-action=>'./somescript.cgi', -method=>'POST'}), TR,td,checkbox_group(-name=>'the_group',-values=>[@the_list],-linebrea +k=>'true',-labels=>\%the_labels), submit(-name=>'submit',-value=>'submit'), end_form() ) );

the problem i have is when i try to place any tabs or extra spaces in the description bits for $the_labels{$bit} they are removed when the routine is returned and displayed on the web page.
I've already tried placing extra spaces in the description and also placing "(&nbsp)" as well but it seems all spaces are removed and the &nbsp is actually printed as part of the checkbox title

foreach $bit (@the_list) { $the_labels{$bit} = $bit . "&nbsp&nbsplabel1 " . " description + "; }

Any help on what i might be doing wrong would be appreciated.

TIA Li

Updated for clarity. What i've got is some perl CGI scripts, one of these scripts functions is to display a vertical list of checkboxes that has a corresponding description next to it.
Now this description is actually derived from different places, so when i display the check_boxes, instead of the label being one complete string seperated by a single space, i actually require tabs and multiple spaces in the description.

The code i got for displaying a checkbox_group came from Perl monks CGI help pages. http://www.perlmonks.com/index.pl?node=perlman%3Alib%3ACGI%3A2

From this code it shows that a checkbox_group label is a pointer to an associative array relating the checkbox values to the user-visible labels.