Why do this with Perl at all? Why can't you just use Javascript to display / fill in the values? Something like:
<html> <head> <title>Checkboxes to Textarea</title> <script type="text/javascript"> function refactor() { var f = document.forms.myform; var s = []; for (var i = 1; i <= 3; i++) if (f.elements['C'+i].checked) s.push(f.elements['C'+i].value); f.command.value = s.join(' '); document.getElementById('command_div').style.display = s.length > 0 ? '' : 'none'; } </script> </head> <body bgcolor="white"> <form name="myform" method="post" action=""> <div id="command_div" style="margin-bottom: 15px; display: none;"> <textarea name="command" rows="3" cols="50"></textarea> </div> <input type="checkbox" name="C1" value="Command 1" onclick="refactor() +;"> Checked Command 1 <input type="checkbox" name="C2" value="Command 2" onclick="refactor() +;"> Checked Command 2 <input type="checkbox" name="C3" value="Command 3" onclick="refactor() +;"> Checked Command 3 </form> </body> </html>
I'm assuming of course that the command is for display purposes only, and will not be submitted directly to the system. You have to be very careful with that sort of thing even if you're filtering it through Perl first.

In reply to Re: CGI Table with checkboxes by TJPride
in thread CGI Table with checkboxes by halecommarachel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.