|
From: Chris M. <Chr...@te...> - 2002-09-09 23:34:40
|
Hi,
Yes, I've actually tried that... and the eq as opposed to == thing - I
wasn't thinking when I wrote that in the email I guess ;-)
Anyway, here's what I've got right now... it's a bit of a mishmash of
different things I've tried. The input is from a form that displays a
number of records. When a record is changed, it sets a 'dirty' variable
(with javascript, a hidden field) so that I can tell which ones have
changed. $count comes from the form to indicate how many records have been
displayed. And, of course, the delete parameter is from a checkbox...
for $i ( 0 .. $count ) {
my $dirty = "dirty".$i;
my $delete = "delete".$i;
... (more variables)
if ($apr->param($dirty) == 1) { # if a given record has changed
my $ref = ref($apr->param($delete));
$R->scrib(0,"precommit: ref 330 $ref delete $delete ");
my $foo = $apr->param($delete);
$R->scrib(0,"foo $foo");
$foo = "off" unless $apr->param($delete);
if ($foo eq "on") {
... (delete type routine)
} else {
... (save type routine)
}
}
}
and this is what I get in the log - records 3, 4, and 6 have changed, 3 and
4 are to be deleted, 6 is not, and it dies...
OpenInteract::Handler::GenericDispatcher::_check_task_security (143) >>
Security after check for (precommit):
user has: 8; user needs: 8
testsite::Handler::Dns::precommit (305) >> precommit: count 18
testsite::Handler::Dns::precommit (331) >> precommit: ref 330 delete
delete3
testsite::Handler::Dns::precommit (333) >> foo on
testsite::Handler::Dns::precommit (331) >> precommit: ref 330 delete
delete4
testsite::Handler::Dns::precommit (333) >> foo on
testsite::Handler::Dns::precommit (331) >> precommit: ref 330 delete
delete6
testsite::Handler::Dns::precommit (333) >> foo
OpenInteract::UI::Main::handler (42) >> Action died. Here is what it left:
Not a CODE reference at
/var/www/testsite/pkg/dns-0.01/testsite/Handler/Dns.pm line 335.
I hope this isn't too much of a jumble...
Thanks again,
Chris
-----Original Message-----
From: Chris Winters [mailto:ch...@cw...]
Sent: September 9, 2002 6:09 PM
To: Chris McDaniel
Cc: 'ope...@li...'
Subject: Re: [Openinteract-help] help with silly checkbox problem...
* Chris McDaniel (Chr...@te...) [020909 17:46]:
> I'm having a huge problem with something that should be simple -
> I'm using a series of checkboxes on a page, and if they are checked, then
> everything is OK. But if they are not checked, then I have problems.
When
> I do something like this:
>
> if ($apr->param($delete) == "on") { # $delete is the name of the checkbox
> with an index, i.e. delete1, delete2, etc.
> ....
> }
My first impression is to split out what you're doing (plus use the
right comparison):
my $is_checked = $apr->param( $delete );
if ( $is_checked eq 'on' ) {
...
}
Other than that, are you having any other issues with Apache::Request?
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988
|