in reply to OT? Checkbox list with CGI/Javascript

For this I suggest you start by forgetting JavaScript, you don't need it. Then make use of the markup validator (you have syntax errors in your HTML). Then...

<input type="checkbox" name="ids" value="1"> <input type="checkbox" name="ids" value="2"> <input type="checkbox" name="ids" value="3">
and
... use CGI; use Data::Dumper; my $cgi = CGI->new(); my @results = $cgi->param('ids');

Replies are listed 'Best First'.
Re^2: OT? Checkbox list with CGI/Javascript
by rashley (Scribe) on Nov 11, 2005 at 16:20 UTC
    This won't work, because we're generating the rows dynamically with the array @userids, and don't know how many we'll have.

      And the problem is...? Given this is a perl site, I think the exhortation to generate text given your @userids is implicit.

      <tmpl_loop userids> <input type="checkbox" name="ids" value="<tmpl_var name>"> </tmpl_loop>
      and in perl
      my %tmpl_vars = ( userids => map { {name => $_} } @userids );
      assuming you're using HTML::Template. Modify as appropriate for your own templating system. You are using a templating system, right?