[Zope] dtml-if and checkboxes

Passin, Tom tpassin@mitretek.org
Fri, 4 Oct 2002 16:46:06 -0400


[Meilicke, Scott]
>=20
> <dtml-if check_box>
>=20
> <dtml-if expr=3D"check_box =3D=3D ('on')">
> The check box is checked!
> </dtml-if>
>=20
> </dtml-if>
>=20
> The above should work, but there may be a better way... Maybe=20
> something like <dtml-if "check_box and check_box =3D=3D ('on')">,=20
> not sure though.

No, because if the checkbox is not checked then there will be no such
variable in the REQUEST, so the if test will fail.  This is how forms
work, as Jim Penny just said.  You have to check for the existence of
the variable by name.

Cheers,

Tom P