[Zope] Weird Date Display Bug in HTML Form

Colyn Brown cbrown@ep.newtimes.com
Tue, 23 Apr 2002 13:32:10 -0800


Put quotes around your value variable. Don't ask me why that works, but it
does.

<input type="text" name="start_date" value="<dtml-var
"(_.DateTime().strftime('%b. %d, %Y'))">">

--colyn brown
Phoenix New Times
Web Developer

> From: Dan Shafer <pydan@danshafer.com>
> Date: Tue, 23 Apr 2002 13:13:59 -0700
> To: zope@zope.org
> Subject: [Zope] Weird Date Display Bug in HTML Form
> 
> I have an HTML form with a text field into which I wish to place the
> current date, properly formatted, as a default value.
> 
> In the form, I have the following DTML:
> 
> <
> input type="text" name="start_date" value=<dtml-var
> "(_.DateTime().strftime('%b. %d, %Y'))">>
> 
> This code is copied verbatim from another page on one of my other Zope
> sites where it produces the day's date just beautifully. In this case, it
> only displays the first formatted element (day name in this case, but I've
> proven that it will display the first item whatever it is) in the form's
> text field.
> 
> If I use the exact same code in a textarea multi-line field on an HTML
> form, it displays the entire formatted date correctly.
> 
> Known bug? Workarounds? Personal insanity?
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )