Commit 3513234c authored by Julien Phalip's avatar Julien Phalip
Browse files

Fixed #16815 -- Rectified the code example for hidden_fields and...

Fixed #16815 -- Rectified the code example for hidden_fields and visible_fields in the forms documentation. Thanks, joonas.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16823 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent c76112cf
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -333,16 +333,13 @@ and visible fields independently: ``hidden_fields()`` and
these two methods::

    <form action="/contact/" method="post">
        {% for field in form.visible_fields %}
            <div class="fieldWrapper">

                {# Include the hidden fields in the form #}
                {% if forloop.first %}
        {# Include the hidden fields #}
        {% for hidden in form.hidden_fields %}
        {{ hidden }}
        {% endfor %}
                {% endif %}

        {# Include the visible fields #}
        {% for field in form.visible_fields %}
            <div class="fieldWrapper">
                {{ field.errors }}
                {{ field.label_tag }}: {{ field }}
            </div>