﻿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
10781	Wrong way to style forms demonstrated in docs	Anders Hovmöller	nobody	"The docs has the following example:
{{{
<form action=""/contact/"" method=""POST"">
    {% for field in form.visible_fields %}
        <div class=""fieldWrapper"">

            {# Include the hidden fields in the form #}
            {% if forloop.first %}
                {% for hidden in form.hidden_fields %}
                {{ hidden }}
                {% endfor %}
            {% endif %}

            {{ field.errors }}
            {{ field.label_tag }}: {{ field }}
        </div>
    {% endfor %}
    <p><input type=""submit"" value=""Send message"" /></p>
</form>
}}}
This has the nasty side effect of not printing out the hidden variables if there are no non-hidden variables, in addition to making the code needlessly complex. This should be changed to:

{{{
<form action=""/contact/"" method=""POST"">
    {% for field in form.visible_fields %}
        <div class=""fieldWrapper"">
            {{ field.errors }}
            {{ field.label_tag }}: {{ field }}
        </div>
    {% endfor %}
    {# Include the hidden fields in the form #}
    {% for hidden in form.hidden_fields %}
        {{ hidden }}
    {% endfor %}

    <p><input type=""submit"" value=""Send message"" /></p>
</form>
}}}
"		closed	Documentation	dev		invalid		boxed@…	Unreviewed	1	0	0	0	0	0
