﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
14710	Form css classes for bound fields are not rendered {{ form.field_name }}	Robert Lujo	Robert Lujo	"Version 1.2 added support for form css styling with two additional form class attributes: 
{{{
    error_css_class = 'error'
    required_css_class = 'required'
}}}
http://docs.djangoproject.com/en/dev/ref/forms/api/#styling-required-or-erroneous-form-rows

This is rendered in container field value e.g. when {{ form.as_ul }} is rendered then we get:
{{{
...
<li class=""required error"">
    <ul class=""errorlist""><li>This field is required.</li></ul>
    <label for=""id_name"">Name:</label>
    <input class=""required error"" type=""text"" name=""name"" id=""id_name"" />
</li>
}}}

So class attributes are placed in container DOM element, in <li> in this case.

But if you want to render fields manually like explained in 
http://docs.djangoproject.com/en/dev/topics/forms/#looping-over-the-form-s-fields

{{{ 
   {{ form.name  }}
}}}

This is rendered without class attributes:
{{{
<input type=""text"" name=""name"" id=""id_name"" />
}}}


I think this should be changed:
{{{
<input class=""required error"" type=""text"" name=""name"" id=""id_name"" />
}}}

In attachment you can find patch that changes this with unit-testing adapted. 
Documentation is not updated.
"		closed	Forms	1.2		wontfix			Design decision needed	1	1	0	0	0	0
