[Templates] creating dynamic hidden fields in templates
Craig Barratt
craig@arraycomm.com
Wed, 06 Mar 2002 09:42:25 -0800
> correct. this does work, but i now end up with a blank value ( literally,
> "" ) as one of the hidden fields. not much of a problem, because i can
> have my pre-processing logic handle that case explicitly. but is there a
> way to avoid it?
>
> IIRC, CGI.pm's hidden method only outputs a hidden field if there is a
> value for the corresponding name. my memory may just not be accurate.
I suspect you do have an empty value on the parameter list. For example:
[%
USE cgi = CGI;
CALL cgi.param("foo", "hello", "", "world");
cgi.hidden(Name => "foo").list.join("\n");
%]
produces:
<input type="hidden" name="foo" value="hello" />
<input type="hidden" name="foo" value="" />
<input type="hidden" name="foo" value="world" />
TT's CGI plugin is just a very thin cover for the real CGI.pm, so
I'm confident this is how the real CGI.pm behaves. So you need to
find out where the empty value ends up on the parameter list.
Craig