Could someone please help me with this?

I've got a form with a checkbox input type on it called carton.

In tt2 when I check to see if the checkbox is checked I do:

[%
  USE cgi=CGI;

  IF cgi.params.carton == 'on';
    %]Cart is on![%
  END;
%]

This works great!

My problem is that I need to also detect if the carton checkbox has been
deselected. I've tried:

[%
  USE cgi=CGI;

  IF cgi.params.exists('carton') && cgi.params.carton == '';
    ## I've also tried defined above
    %]Cart is off![%
  END;
%]

I see no way to tell if the checkbox was unselected.

If I point my browser to the url instead of clicking on a submit button
that goes to the page I would like to see a difference.

When I do a form submit cgi.params.exists('carton') should be true but
it should have no value if the checkbox is unselected. If I just point
my browser to the page no form variables should exist so
cgi.params.exists('carton') should be false.

I hope I'm making sense.

Can anybody help me?

-- 
Kip Lawrence <[EMAIL PROTECTED]>
JK Crafts

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to