RE: hidden field value not getting set

2001-06-29 Thread Moon, John

Thank you for the info ...

"-override=>1" did what you stated ...

I tried using CGI qw(-nosticky) ... but it doesn't seem to do it ...

Am I stating this pragma incorrectly ?

Are all "named" parameters "sticky" for each invocation of a "-name=>"
parameter ?

I guess I'm not understanding "what/how much" is being "sticky" ...
Can anyone expand on this ?

-Original Message-
From: Howdy! [mailto:[EMAIL PROTECTED]]
Sent: June 28, 2001 22:13
To: Moon, John
Subject: Re: hidden field value not getting set


- Original Message -
From: "Moon, John [EMAIL PROTECTED] X"
Subject: hidden field value not getting set


> Below is code to generate one or two forms...
> When both forms are generated the "hidden" value for the second form is
not
> getting replaced with the "correct" value...
>
> Does anyone see a problem with this code ?



> foreach (sort keys %buttons) {
> $row .= $q->td({-align=>'CENTER',-colspan=>"$span"},
> $q->start_form(-name=>"$buttons{$_}[2]"),
> $q->submit(-name=>"$buttons{$_}[1]"),"\n",
> $q->hidden(-name=>'ACCT',
> -value=>"$REQUEST{ACCT}"),"\n",
> $q->hidden(-name=>'CUST_ID',
> -value=>"$REQUEST{CUST_ID}"),"\n",
> $q->hidden(-name=>'TITLE',
> -value=>"$REQUEST{TITLE}"),"\n",
> $q->hidden(-name=>'ACTIVE',
> -value=>"$REQUEST{ACTIVE}"),"\n",
> $q->hidden(-name=>'START',
> -value=>"$buttons{$_}[0]"),"\n", # < Problem ?
> $q->hidden(-name=>'END',
> -value=>"$REQUEST{END}"),"\n",
> $q->hidden(-name=>'INITIAL',
> -value=>'NO'),"\n",
> '');
> }



CGI.pm's form parameters are STICKY.  To override them add '-override=1' to
each call to $q->hidden or other types of parameters.

Joel





hidden field value not getting set

2001-06-28 Thread Moon, John

Below is code to generate one or two forms... 
When both forms are generated the "hidden" value for the second form is not
getting replaced with the "correct" value...

Does anyone see a problem with this code ?

Thanks in advance ...


print $q->p($q->center(
"Items from $REQUEST{START} to $displayed of $REQUEST{END} items"));
# <-- values OK here !
exit if $REQUEST{END} <= $max_lines;# No "Previous" or "Next"
# Display previous & next buttons when appropriate
my $span = 9;

my %buttons = ();
if ($REQUEST{START} > 1) {
 $span = 6;
$buttons{'1'}
= [($REQUEST{START},"Previous $REQUEST{START}
Items",'prev')];
}
# are there more to display  ?
if ($REQUEST{START} < $REQUEST{END}) {
 $span -=3;
$displayed++;
$buttons{'2'}
= [($displayed,"Next $displayed Items",'next')];
}
$row = '';
foreach (sort keys %buttons) {
$row .= $q->td({-align=>'CENTER',-colspan=>"$span"},
$q->start_form(-name=>"$buttons{$_}[2]"),
$q->submit(-name=>"$buttons{$_}[1]"),"\n",
$q->hidden(-name=>'ACCT',
-value=>"$REQUEST{ACCT}"),"\n",
$q->hidden(-name=>'CUST_ID',
-value=>"$REQUEST{CUST_ID}"),"\n",
$q->hidden(-name=>'TITLE',
-value=>"$REQUEST{TITLE}"),"\n",
$q->hidden(-name=>'ACTIVE',
-value=>"$REQUEST{ACTIVE}"),"\n",
$q->hidden(-name=>'START',
-value=>"$buttons{$_}[0]"),"\n", # < Problem ? 
$q->hidden(-name=>'END',
-value=>"$REQUEST{END}"),"\n",
$q->hidden(-name=>'INITIAL',
-value=>'NO'),"\n",
'');
}

generates ...


Items from 11 to 20 of 69 items