The problem with using:
[% cgi.params.carton != 'on' %]
is that I can't tell if the carton checkbox really was unselected. The
above code would be true if I did unselect it. Or it would also be true
if I hit the page by typing the URL into my browser. I need to be able
to tell that for sure the checkbox was unselected.
Is there no way to tell if a key exists in a hash? Even if it contains
''.
Or is it that the cgi module always returns '' instead of undef if a key
doesn't exists in cgi.params.
For now I've done the following:
[%
IF cgi.params.size != 0 && cgi.params.showcart == '';
### It has been deselected
END;
%]
Can anybody think of a better (more correct) approach?
Thanks,
--
Kip Lawrence <[EMAIL PROTECTED]>
JK Crafts
On Fri, 2003-11-21 at 11:39, darren chamberlain wrote:
> * Kip Lawrence <kip at jkcrafts.com> [2003/11/21 11:31]:
> > My problem is that I need to also detect if the carton checkbox has
> > been deselected.
>
> Does:
>
> [% cgi.params.carton != 'on' %]
>
> not work?
>
> (darren)
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates