Dear Florian Reiser, Thank you for the help. It is been working fine when I changed from <dtml-if "Child_Enrollment_Date=='None'"> to <dtml-if Child_Enrollment_Date==_.None">. Thanks & Regards Praveen On Tue, 2003-10-07 at 16:44, Florian Reiser wrote:
Dear Praveen,
try: <input type="text" name="date3:date" size="15" value="<dtml-if "Child_Enrollment_Date==_.None"><dtml-var Child_Enrollment_Date null=""><dtml-else><dtml-call "REQUEST.set('Child_Enrollment_Date1',Child_Enrollment_Date.strftime('%m /%d/%Y'))"><dtml-var Child_Enrollment_Date1 null=""></dtml-if>">
The NULL value from your database gets converted to the python value None.
Regards Florian Reiser
-----Original Message----- From: zope-bounces@zope.org [mailto:zope-bounces@zope.org] On Behalf Of K. Praveen Kumar Sent: Tuesday, October 07, 2003 12:43 PM To: zope@zope.org; Praveen Kumar Cc: dieter@handshake.de; cms@adytumsolutions.com; allison@sumeru.stanford.EDU; lukesh@seznam.cz Subject: [Zope] DTML-IF problem
Dear All, I am getting problem while evaluating the condition. I am retrieving the values from MySQL database to show in the text boxes. Here I would like to test whether the data in the database is empty or not. If empty then I would like to show one message, if not I wanted to get the value.
This is the code: *****************************************************************
<input type="text" name="date3:date" size="15" value="<dtml-if "Child_Enrollment_Date=='NULL'"><dtml-var Child_Enrollment_Date null=""><dtml-else><dtml-call "REQUEST.set('Child_Enrollment_Date1',Child_Enrollment_Date.strftime('%m /%d/%Y'))"><dtml-var Child_Enrollment_Date1 null=""></dtml-if>">
***************************************************************** It is every time executing the <dtml-else> part. How can I validate the 'Null'? Please give your suggestions on this