[dancer-users] Trapping parameters from a dynamic list of checkboxes.
Richard Reina
gatorreina at gmail.com
Thu Aug 27 15:28:01 BST 2015
Hi WK,
Thanks for your reply. I am trying to get it to work.
my $Accomps = $dbh->selectall_hashref( $q, 'ID' );
>
After figuring out how to accommodate my placeholder in selectall_hashref I
did this:
my $Accomps = $dbh->selectall_hashref( $q, 'ID', \%attr, $Sid );
Then as you suggested I do:
# get parameter for accomp type keys
foreach my $key ( keys %$Accomps ) {
print "Checking: " . $key . " for value.\n";
if ( param( $key ) ) {
$input_hash->{ $key } = $Accomps->{ $key };
print $key $input_hash->{ $key } . "\n";
}
}
(just printing temporarily to see if it trapped the values)
However, I get this error:
Route exception: Can't use string ("1") as a symbol ref while "strict
refs" in use at /home/richard/Dancer2/MyApp/bin/../lib/MyApp.pm line 557.
Any idea what I am doing wrong?
>
> # 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
> _______________________________________________
> dancer-users mailing list
> dancer-users at dancer.pm
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20150827/336b74bb/attachment.html>
More information about the dancer-users
mailing list