[Zope] dtml-if and checkboxes

Hires, Russell (CAP, CARD) Russell.Hires@gecapital.com
Fri, 4 Oct 2002 16:15:01 -0400


Hey All,

I'm experimenting with zope again, playing with the REQUEST object and form
objects. In my latest delimma, I've got the following snippet:

<dtml-if expr="check_box == ('on')">
The check box is checked!
</dtml-if>

What I don't get: if the checkbox is checked in the form, then this works,
and I get the output. If it isn't checked, then I get an error saying that
the checkbox ("check_box" in the form) isn't defined. This is borne out as
well by <dtml-var expr="REQUEST.form">, which shows a text box's name and
the value that it holds (whether it holds a value or not), and the
checkbox's name and value ('on'), when it's checked. If it isn't checked, it
isn't there at all. So, I guess I'm going to have to look to see whether
it's there or not, right? How would I do that?

Thanks for the help!

Russell