perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Axel Beckert - ecos gmbh <beck...@ecos.de>
Subject Re: [$hidden$] behaviour
Date Mon, 04 Nov 2002 13:47:12 GMT
Hi!

On Sat, Oct 26, 2002 at 01:01:12AM -0400, Jordan Baker wrote:
> A query about [$hidden$] tag. It appears that subsequent executions of
> [$hidden$] tag cause me to lose the first form element that was passed.
>
> Is this the expected behaviour?

Yes, it is. Let me explain why:
 
> <form action="bug1.epl">
> [$ hidden $]
> <input type="submit" name="foo" value="Submit 1">
> </form>
> <p>
> <form action="bug1.epl">
> [$ hidden $]
> <input type="submit" name="foo" value="Submit 1">
> </form>
> <form action="bug1.epl">
> [$ hidden $]
> <input type="submit" name="foo" value="Submit 1">
> </form>
> 
> The output when called as bug1.epl?foo=1&bar=2:
> 
> <form action="bug1.epl">
> <input type="hidden" name="foo" value="1"><input type="hidden" name="bar" value="2">

Embperl's [$hidden$] outputs all form fields stored in %fdat, which
have not shown up in the source code before.

At this point no form input fields have shown up, so alle submitted
form fields show up.

> <input type="submit" name="foo" value="Submit 1">

Now one of the fields (notice the 'name="foo"') is present in the
source code, so we don't have to output them any more. This is the
reason, why it doesn't show up in the rest of page when [$hidden$] is
called again.

> </form>
> <p>
> <form action="bug1.epl">
> <input type="hidden" name="bar" value="2"> *** NOTE missing form value "foo"
> <input type="submit" name="foo" value="Submit 1">
> </form>
> <form action="bug1.epl">
> <input type="hidden" name="bar" value="2"> *** NOTE missing form value "foo" 
> <input type="submit" name="foo" value="Submit 1">
> </form>
> 
> I worked out a temporary workaround for this issue in the interim:
> 
> [- %nodat = () -]
> 
> And then instead of using [$hidden$] I use [$hidden %fdat %nodat $]
>
> Wondering what should be done in this case,

I would just rename the submit button's name to something else than
'foo' and it should work as expected.

            Kind regards, Axel Beckert
-- 
-------------------------------------------------------------
Axel Beckert      ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     beckert@ecos.de         Voice:    +49 6133 926530
WWW:        http://www.ecos.de/     Fax:      +49 6133 925152
-------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message