[Zope] RE: [ZPT] Formulator Problem
beno
zope@thewebsons.com
Thu, 31 Oct 2002 19:02:55 -0400
At 09:26 AM 10/31/2002 +0000, you wrote:
>Hi,
>
>This works for me:
>
><div metal:fill-slot="content" tal:replace="structure
>here/forms/frmStudentLayout/render">FORM</div>
That works well for rendering the form. Thank you.
>This also works for me:
>
>Username:<br>
><span tal:condition="python:request.REQUEST_METHOD == 'POST'"
>tal:content="structure python:formErrors['username']" tal:on-error="string:"
>style="color:red">error goes here</span>
><input tal:attributes="value request/field_username" tal:on-error="string:"
>name="field_username" type="text" id="field_username">
><br>
>
>
>where formErrors is
>global formErrors python:container.check_form(container.form.login)
>
>form is once again a "form folder" and login is a formulator object.
>
>and this is where I got my inspiration
>http://www.zopelabs.com/cookbook/1032909599
Yes. I saw that too in my research. But I am not looking to authenticate
users. The validation I seek is that which is built into Formulator but
doesn't seem to work with TAL.
Of much_greater_importance is getting the fields to render. In other words,
after the visitor has filled out the form, I need to be able to call and
use those fields. For example, how do I thank the visitor by name using
TAL? How do I do the equivalent of this:
<dtml-var your_name>
TIA,
beno
>Hope this helps ;O)
>
>Chris
>
>-----Original Message-----
>From: zpt-admin@zope.org [mailto:zpt-admin@zope.org]On Behalf Of beno
>Sent: 30 October 2002 19:22
>To: zpt@zope.org
>Subject: [ZPT] Formulator Problem
>
>
>Hi;
>I have the following code in a ZPT page:
>
><table tal:define="form here/email_us_formulator" align=center>
> <tr tal:define="yourname request/YourName|nothing">
> <th align="left">
> <font tal:attributes="size python:here.sizeCalc2(5,here.size())"><font
>face="verdana"><b>
> Your Name:
> </b></font></font>
> </th>
> <td><input type="text" name="YourName"
> tal:replace="structure
>python:form.YourName.render(yourname)">
> </td>
> </tr>
>...etc.
>
>This renders like this:
>
><table align="center">
> <tr>
> <th align="left">
> <font size="4"><font face="verdana"><b>
> Your Name:
> </b></font></font>
> </th>
> <td><input size="20" value="" type="text" name="field_YourName" />
> </td>
> </tr>
>...etc.
>
>When the form is submitted, it goes to a page with the following code:
>
>Thank you, <p tal:replace="structure
>python:here.email_us_formulator.YourName">YourName</p>!
>
>and renders like this:
>
>Thank you, <StringField instance at 8f2dec8>!
>
>What have I done wrong?
>Furthermore, Formulator no longer validates at all for some reason. Why?
>TIA,
>beno
>
>
>
>_______________________________________________
>ZPT mailing list
>ZPT@zope.org
>http://lists.zope.org/mailman/listinfo/zpt