[dancer-users] Trapping parameters from a dynamic list of checkboxes.

WK wanradt at gmail.com
Wed Aug 26 23:03:22 BST 2015


2015-08-27 0:35 GMT+03:00 Richard Reina <gatorreina at gmail.com>:

> I am trying to find a way to get values back from a dynamic list of
> checkboxes.

# you need to get your list of checkbox fields, one way you query it
from DB again:
my $Accomps = $dbh->selectall_hashref( $q, 'ID' );

# Then:
my $input_hash = {
       Tech => param('tech'),
       Type => param('type'),
};

foreach my $key ( keys %$Accomps ) {
  if ( param( $key ) ) {
    $input_hash->{ $key } = $Accomps->{ $key };
  }
}


Wbr,
-- 
Kõike hääd,

Gunnar


More information about the dancer-users mailing list