in reply to Re: CGI/HTML checkboxes to SQL query
in thread CGI/HTML checkboxes to SQL query

Okay this is an update on the problem. The good news is that I no longer get any errors. However, the script just goes ahead and executes the sql statement but without taking the form values into account. I will put this on my scratch pad, if anyone wants to take a look...... I would appreciate this. Thanks, Rachel
  • Comment on Re: Re: CGI/HTML checkboxes to SQL query

Replies are listed 'Best First'.
Re: Re: Re: CGI/HTML checkboxes to SQL query
by rdfield (Priest) on Nov 27, 2002 at 09:42 UTC
    It would be best to add the code on your scratchpad to the end of your previous node: for posterity, you know. Anyway, the problem seems to be with the HTML (as originally pointed out by theorbtwo in the CB): you have named all of your checkboxes "drive", so in order for your code to work you need something like (and this is untested):
    my %hash = (Initiative=>'DriveInitiative', ResOrientation => 'DriveResOrient', Creativity => 'DriveCreativity', ChangeOrientation => 'DriveChangeOrient', DecisionMaking => 'DriveDecisionMake', SelectLevel => 'ResLevel', ManagesPeople => 'ResManage'); my @checked = split /\0/,$cgi->param('drive'); my @clauses; foreach my $checkbox (@checked) { push @clauses, $hash{$checkbox} if validate($checkbox); }

    rdfield