#2341: tw.forms version 0.9.6 does not display validation errors with Form,
ListForm and TableForm
---------------------+------------------------------------------------------
Reporter: cd34 | Owner: Chris Arndt
Type: defect | Status: new
Priority: normal | Milestone:
Component: Widgets | Version: 2.0.1
Severity: normal | Resolution:
Keywords: |
---------------------+------------------------------------------------------
Comment (by cd34):
If Field labels should be displayed with Form, the following patch enables
that.
{{{
--- /var/www/tg201orig/lib/python2.5/site-
packages/tw.forms-0.9.7.2-py2.5.egg/tw/forms/templates/form.html
2009-07-30 17:58:43.263969462 -0400
+++ form.html 2009-07-30 20:33:51.769712506 -0400
@@ -11,7 +11,14 @@
${Markup(field.display(value_for(field), **args_for(field)))}
</py:for>
<py:for each="field in fields">
- ${Markup(field.display(value_for(field), **args_for(field)))} <br
/>
+ <label id="${field.id}.label"
+ py:with="required = [None,'
required'][int(field.is_required)];
+ error = error_for(field);"
+ class="fieldlabel${required}"
+ py:if="field.label_text" py:content="field.label_text" />
+ ${Markup(field.display(value_for(field), **args_for(field)))}
+ <span py:if="error and not error.error_dict" class="fielderror"
py:content="error" />
+ <br />
</py:for>
</div>
</form>
}}}
--
Ticket URL: <http://trac.turbogears.org/ticket/2341#comment:2>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---