[ZPT] DRAMA: Can Formulator Play Nicely With ZPT? (Part II)
beno
zope@thewebsons.com
Fri, 11 Oct 2002 18:20:02 -0400
Hi;
This is my SECOND POST concerning this question. I KNOW someone out there
has the answer. Hopefully that person will be kind enough to help...
I'm trying to follow a recipe someone named *macquyver007* posted on
zopelabs for using Formulator. (I've done away with his check_form script
since I'm not interested in authenticating users.) Here's a code snippet:
<form name="email_us_formulator" method="post" action="email_us.zpt">
Your Name:<br>
<input tal:condition="python:request.has_key('field_Your Name')"
tal:attributes="value request/field_Your Name" name="field_Your Name"
type="text" id="field_Your Name">
<input tal:condition="python:not request.has_key('field_Your
Name')" name="field_Your Name" type="text" id="field_Your Name">
<br>
Your Phone:<br>
<input tal:condition="python:request.has_key('field_Your Phone')"
tal:attributes="value request/field_Your Phone" name="field_Your Phone"
type="text" id="field_Your Phone">
<input tal:condition="python:not request.has_key('field_Your
Phone')" name="field_Your Phone" type="text" id="field_Your Phone">
<br>
Your Email:<br>
<span tal:condition="python:request.REQUEST_METHOD == 'POST'"
tal:content="structure python:formErrors['Your Email:']"
tal:on-error="string:" style="color:red">error goes here</span>
<input tal:condition="python:request.has_key('field_Your Email')"
tal:attributes="value request/field_Your Email" name="field_Your Email"
type="text" id="field_Your Email">
<input tal:condition="python:not request.has_key('field_Your
Email')" name="field_Your Email" type="text" id="field_Your Email">
<br>
Your Comments:<br>
<span tal:condition="python:request.REQUEST_METHOD == 'POST'"
tal:content="structure python:formErrors['Your Comments:']"
tal:on-error="string:" style="color:red">error goes here</span>
<input tal:condition="python:request.has_key('field_your_comments')"
tal:attributes="value request/field_Your Comments"
name="field_your_comments" type="textarea" id="field_Your Comments">
<input tal:condition="python:not request.has_key('field_Your
Comments')" name="field_Your Comments" type="text" id="field_Your Comments">
<br>
</center><br>
<input type="submit" value=" OK ">
My problems are these:
Why doesn't the form validate? How do I make it validate?
How do I incorporate a textarea? I've tried changing the *input* part of
the tag, but that simply makes the tag disappear!
TIA,
beno