How to use multiple checkboxes with the same name in TT / Perl?

Khalid Akram <[email protected]> Thu, 28 Jun 2012 08:54:09 +0000
Newsgroups gmane.comp.lang.perl.modules.template-toolkit
Message-ID <[email protected]>
Hi,

I am having an issue using multiple checkboxes with the same name with TT.

If I have some checkboxes like this:

<input type="checkbox" name="options" value="1">
<input type="checkbox" name="options" value="2">
<input type="checkbox" name="options" value="3">

If I select 3 of these and submit, what gets posted to the CGI is this:

options=1&options=2&options=3;

In my receiving script I have:


my $options = $query->param( "options" );


which only gives me the first value!! What I need is a comma separated list that I can then loop over.


What is the best way around this?


Thanks


Khalid

Web Developer,

Farringdon, London.

This e-mail has been scanned for all viruses by Star.