[Zope] Testing for Equality
CLIFFORD ILKAY
clifford_ilkay@dinamis.com
Thu, 14 Feb 2002 04:28:01 -0500
Hi,
I have a form which the user is supposed to indicate whether their
residence is the same as their spouse's residence. If the mother and father
live in the same residence, I want to skip the mother's address because we
already have it. If the residence is not the same, I want the user to enter
the mother's address. Here is how I implemented it.
I have a form called maritalStatus on which the user selects from a radio
button group their marital status and also selects Yes or No to the
question about the residence address. The post method for that form is a
folder name, forms, in which index_html is a form which is used to enter
the father's info. This form receives a variable called SAME_RESIDENCE from
the maritalStatus form. I need to pass SAME_RESIDENCE on from the father's
form to the mother's form so I have a hidden field in the form which looks
like this:
<input type=hidden name=SAME_RESIDENCE.<dtml-var
expr="_.getitem('SAME_RESIDENCE')">:record>
The post method for the father's form is a folder called mothers which is
contained within forms. Its index_html is the mother's info form.
SAME_RESIDENCE is passed to it by the father's form in REQUEST.form. I am
having difficulty with testing for the value of SAME_RESIDENCE. Here is the
code I am using.
<dtml-if expr="_.getitem('SAME_RESIDENCE')=='Y'">
Same residence
<dtml-else>
Not the same residence
</dtml-if>
The expression always evaluates false so I guess I am doing something
wrong. For debugging purposes, I added the following to the top of the page:
<p>Same Residence = <dtml-var expr="_.getitem('SAME_RESIDENCE')"></p>
and the value of SAME_RESIDENCE changes appropriately as I select Yes or No
on the maritalStatus form so I know that it is not the problem. Any idea
what I am doing wrong?
Regards,
Clifford Ilkay
Dinamis Corporation
3266 Yonge Street, Suite 1419
Toronto, Ontario
Canada M4N 3P6
Tel: 416-410-3326
mailto:clifford_ilkay@dinamis.com
Only 24 days to AmerOmnis 2002.
Register at <http://www.AmerOmnis.com>.