I found the example very useful, but had to struggle some
time to get it running.
If you create the formulator object 'login' create only
the fields with name 'username' and 'password' without a title!.
In 'sign_in.html' use these lines.
There are two changes:
1. tal:condition="python:test(...)"
2. tal:content="structure python:formErrors['username']"
I don't know why the original example doesn't worked for me
using Zope 2.5.1.
=============================================================
Username:<br>
<span
tal:condition="python:test(request.REQUEST_METHOD == 'POST', 1, 0)"
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/>
Password:<br>
<span
tal:condition="python:test(request.REQUEST_METHOD == 'POST', 1, 0)"
tal:content="structure python:formErrors['password']"
tal:on-error="string:" style="color:red">error goes here</span>
<input tal:attributes="value request/field_password"
tal:on-error="string:"
name="field_password" type="text" id="field_password">
<br/>
<input type="submit"/>
|