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

Wise Monks, I am still a newbie @ cgi. In my current project, I have 2 scrolling_lists and a radio_group in my cgi script. I would like to put the scrolling_lists side by side instead of one below another. Is there any way of doing this in cgi? Do I need to have templates? Please help. So far the response from perlmonks is great. Regards, Rakhee
print $cgi->startform; print $cgi->h3('Select Project to view QA Metrics'); print $cgi->br; print $cgi->br; print "<em><b>Enter Start Date [dd/mm/yyyy]</b></em><br>"; print $cgi->textfield(-name=>'start_date', -default=>'07/03/2009', -size=>9, -maxlength=>80); print $cgi->br; print $cgi->br; print "<em><b>Enter End Date [dd/mm/yyyy]</b></em><br>"; print $cgi->textfield(-name=>'end_date', -default=>'08/01/2010', -override=>true, -size=>9, -maxlength=>80); print $cgi->br; print $cgi->br; print $cgi->br; print "<b>Select Project to View QA Metrics</b><br>"; print $cgi->br; print $cgi->scrolling_list(-name=>'Projects', -value=>[ 'ARES', 'POSEIDON_SW', 'DEIMOS', 'MIMAS', 'JUPITER', 'POSEIDON', 'DIONYSUS'], -size=>8, -multiple=>'true', -default=>'ARES'); print $cgi->br; print $cgi->br; print "<b>Select from P1, P2, or P1+P2 Bugs Data</b><br>"; print $cgi->br; print $cgi->radio_group(-name=>'P1P2_bugs', -values=> ['P1', 'P2','P1-P2'], -default=>['P1'], -linebreak=>'true'); print $cgi->br; print $cgi->submit(-value=>'Submit Project'); print $cgi->endform;

Replies are listed 'Best First'.
Re: How do I put scrolling_list side by side in my start_form
by Your Mother (Archbishop) on Mar 17, 2010 at 19:20 UTC

    This is a CSS/HTML question. If you are dealing with HTML you really, really need to learn CSS or you'll never be able to get good results. Here is a solution with the CGI stuff-

Re: How do I put scrolling_list side by side in my start_form
by CountZero (Bishop) on Mar 17, 2010 at 19:18 UTC
    How your pages look has nothing to do with CGI. This is just a matter of HTML and --preferably-- CSS.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re: How do I put scrolling_list side by side in my start_form
by almut (Canon) on Mar 17, 2010 at 19:12 UTC
    I have 2 scrolling_lists and a radio_group in my cgi script. I would like to put the scrolling_lists side by side

    I only see one scrolling_list... but anyway, the simplest way would be to not put a <br /> (i.e. $cgi->br) in between them.

      Thank you, monk. I am looking into css for formats.
Re: How do I put scrolling_list side by side in my start_form
by pemungkah (Priest) on Mar 17, 2010 at 19:18 UTC
    I strongly suggest that now is the time to take a look at CSS (Cascading Style Sheets). CSS enables you to decouple presentation (the way it looks) from semantics (what is there).

    This isn't the place to try to do a full CSS tutorial; this one is pretty good as a survey. What you'll be doing is adding a few more tags - <div> and <span> - to define specific chunks of your page and where to put them. It's a great tool and a way to distinguish yourself from just another CGI programmer.

    CSS will take you the next step up from "okay, I got the data on the page" to "wow, that really looks good!". An inspirational example is the CSS Zen Garden; all the variant presentations are done via CSS using the same base page markup.